What URL encoding does and why you need it
A URL can only safely carry a small subset of ASCII characters. Everything else — spaces,
accented letters, emoji, and the structural symbols a browser uses to route a request — has to
be percent-encoded before it can travel reliably across the web. This tool
converts text in both directions using the browser's native
encodeURIComponent and decodeURIComponent, so the result matches
exactly what a server or another application will see.
Under the rules of RFC 3986, each byte that needs escaping is written as a percent sign
followed by its two-digit hexadecimal value. A space becomes %20, an ampersand
becomes %26, and a UTF-8 character such as é expands to
%C3%A9 — two bytes, two escapes. Decoding reverses the process.
A worked example
Suppose you want to put the search phrase cafés & bars into a query string.
Encoding it gives caf%C3%A9s%20%26%20bars: the accented é becomes its
two UTF-8 octets, the spaces become %20, and the ampersand becomes
%26 so it is not mistaken for a separator between parameters. Paste a whole URL
instead and the parser below splits it on the ? and lists every key and value for
you.
Reserved characters worth knowing
| Character | Structural role in a URL | Encoded |
|---|---|---|
| space | Word separator (not allowed raw) | %20 |
? | Starts the query string | %3F |
& | Separates key=value pairs | %26 |
= | Binds a key to its value | %3D |
/ | Path segment separator | %2F |
# | Starts the fragment / anchor | %23 |
The unreserved characters A–Z a–z 0–9 - . _ ~ are never encoded — they have no
special meaning, so they always pass through untouched in either direction.