What is the URL Encode / Decode?
URLs may only contain a limited set of ASCII characters. URL encoding (percent-encoding, RFC 3986) replaces any other character with % followed by two hexadecimal digits for each UTF-8 byte. A space becomes %20, & becomes %26 and é becomes %C3%A9.
Choose the right mode. Component mode (like JavaScript's encodeURIComponent) encodes everything except letters, digits and -_.~, so use it for a single query parameter value or path segment. Full URL mode (like encodeURI) leaves structural characters such as :/?#&= alone, so use it to clean up a whole URL that contains spaces or non-ASCII text. HTML forms encode spaces as + instead of %20; tick Spaces as + to match that.
How to use the URL Encode / Decode
- Paste the text or URL you want to encode or decode.
- Choose Component for a query value, or Full URL for a complete address.
- Click Encode or Decode and copy the result.
Frequently asked questions
When should I use encodeURIComponent instead of encodeURI?
Use component encoding for a value you put inside a URL, such as ?q= plus the user's search text. If you used encodeURI, an & in the value would split it into a new parameter.
Why is my text double-encoded (%2520)?
%2520 means an already encoded %20 was encoded again. Decode it twice, and make sure your code encodes each value only once.
Is a space %20 or +?
Both appear. %20 is correct everywhere in a URL. + means a space only in application/x-www-form-urlencoded query strings, the format used by HTML forms.