URL Encoder / Decoder
Encode special characters in URLs and query strings, or decode them back to plain text. Supports both encodeURIComponent (query params) and encodeURI (full URLs). Everything runs in your browser — nothing is sent to any server.
Related Tools
Frequently Asked Questions
What is the difference between %20 and + for encoding a space?▾
They come from two different standards. RFC 3986 (the URI standard) encodes a space as %20 — there is no concept of + meaning a space outside of a query string. The application/x-www-form-urlencoded format (used by HTML forms) encodes spaces as + in query strings. Both are valid in query strings, but only %20 is valid in path segments. If you are building a URL path, always use %20. If you are building a query string, + is safe but %20 is unambiguous across all contexts.
What is the difference between encodeURI() and encodeURIComponent() in JavaScript?▾
encodeURI() is designed for a complete URL — it leaves structural characters like /, ?, #, &, =, and : unencoded. encodeURIComponent() encodes those characters too, making it suitable for encoding individual query parameter values or path segments. If you use encodeURI() on a query value that contains & or =, those characters will break the query string parsing. Use encodeURIComponent() for any data value you embed inside a URL.
Why does double-encoding happen and how do I avoid it?▾
Double-encoding occurs when an already-encoded string like hello%20world gets encoded again, producing hello%2520world (because % becomes %25). This happens when two layers of code both call an encoding function on the same string, or when you encode an entire URL instead of encoding only the individual data values before assembling the URL. The fix is to encode each component (path segment, query value) separately before joining them with structural characters like ?, &, and =.
Which characters are safe to leave unencoded in a URL?▾
RFC 3986 defines 'unreserved characters' that never need encoding: A–Z, a–z, 0–9, and the four symbols -, ., _, ~. Reserved characters like /, ?, #, &, = have structural meaning and must be percent-encoded if they appear as data. The application/x-www-form-urlencoded format is even stricter — it encodes everything except ASCII alphanumerics and *, -, ., _.
How are non-ASCII characters like accents or Chinese characters encoded in a URL?▾
Non-ASCII characters must be encoded using their UTF-8 byte representation in percent-encoded form. For example, the euro sign € encodes as %E2%82%AC because its UTF-8 encoding is three bytes: 0xE2, 0x82, 0xAC. Internationalized domain names (IDN) use a separate system called Punycode for the hostname portion. UTF-8 is the correct encoding to use for all modern web applications.