URL Encoder / Decoder
Encode special characters for use in URLs or decode percent-encoded strings. Runs entirely in your browser.
Why URLs Need Encoding
URLs can only contain a limited set of ASCII characters. Characters outside this set — spaces, special symbols, non-ASCII Unicode — must be percent-encoded before inclusion in a URL. Without encoding, a URL containing a space would break because HTTP parsers treat spaces as delimiters. Special characters like &, =, ?, and # have structural meaning in URLs — using them in query parameter values without encoding causes the URL parser to misinterpret the structure.
Percent-Encoding Explained
Percent-encoding replaces each byte of the character's UTF-8 representation with a % followed by two hex digits. A space becomes %20; an ampersand becomes %26; a non-ASCII character like é (U+00E9) is encoded as two bytes in UTF-8 (0xC3 0xA9), becoming %C3%A9. JavaScript's encodeURIComponent() encodes everything except unreserved characters (letters, digits, -, _, ., ~). Use it for encoding query parameter values. encodeURI() preserves structural characters like /, ?, and & — use it for encoding full URLs, not individual parameter values.
Common Developer Pitfalls
Double-encoding is the most common URL encoding bug: encoding an already-encoded string converts %20 into %2520 (encoding the % itself). Always decode before re-encoding. Forgetting to encode query parameter values when constructing URLs programmatically causes broken links when values contain & or =. Use URLSearchParams in JavaScript to construct query strings — it handles encoding automatically and is less error-prone than manual string concatenation.
Related Tools