URL Encoder / Decoder

Encode and decode URLs and query parameters. Supports encodeURIComponent for params and encodeURI for full URLs

How URL Encoding Works

URL encoding (also called 'percent-encoding') replaces special characters with %XX where XX is the hex code of the character. So a space becomes %20, & becomes %26, # becomes %23. RFC 3986 defines which characters need encoding. Letters, digits, and -_.~ are 'unreserved' and pass through unchanged.

Used everywhere URLs include user input. Search queries: 'hello world' becomes 'hello%20world' (or 'hello+world' in form data). Special characters in URLs: 'cafΓ©' becomes 'caf%C3%A9' (UTF-8 bytes percent-encoded). Always encode untrusted input before placing it in a URL - failure to encode causes broken links and is a common source of XSS vulnerabilities.

Common URL Encodings

CharacterEncoded
space%20 (or + in forms)
#%23
&%26
?%3F
/%2F
:%3A
=%3D
@%40
cafΓ© (UTF-8)caf%C3%A9

Frequently Asked Questions

Why are some characters encoded and others not?

Reserved characters (?, &, =, /, etc.) have special meaning in URLs - encoding preserves their literal value when used in data. Unreserved (letters, digits, -_.~) have no special URL meaning and stay as-is. The line is set by RFC 3986 spec; modern systems follow it strictly.

Is + the same as %20?

In query strings (form data after ?): yes, + represents space. In path components (before ?): no, + is literal +. Use %20 if you want a space in a path component. Most URL encoders default to + for query strings, %20 for paths.

More tools β†’