What Is URL Encoding?
URL encoding (percent-encoding) replaces characters that are unsafe in a URL with % and two hex digits. A space becomes %20. It keeps a query value from being read as another parameter.
The idea
A URL has reserved characters. & starts the next query field. # starts the fragment. A space is not allowed raw. Percent-encoding writes a character as % plus its UTF-8 bytes in hex so those meanings stay intact.
| Character | Encoded |
|---|---|
| space | %20 |
& | %26 |
= | %3D |
ö | %C3%B6 |
encodeURIComponent vs encodeURI
encodeURIComponent encodes almost every reserved character. Use it for one query value or one path segment. encodeURI leaves : / ? # alone because it assumes you already have a full URL. The MultiConvers URL encoder uses encodeURIComponent / decodeURIComponent.
Example: the value a&b=c must become a%26b%3Dc inside ?q=, or the server sees two extra parameters.
Not Base64
Percent-encoding keeps text as text with a few escapes. Base64 rewrites arbitrary bytes as a different alphabet. You might Base64 a blob and then percent-encode that blob for a query — two different jobs. Base64 is still not encryption; see what Base64 is.
FAQ
- Is %20 the same as a + for a space?
In application/x-www-form-urlencoded bodies, + often means space. In a path or in encodeURIComponent output, a space is %20. This tool uses %20.
- Should I encode an entire URL I already have?
Usually no. Encode each query value or path segment. Encoding the whole string will percent-encode the :, /, and ? you still need as structure.
Related guides
Related tools
See all guides.