URL Encoder Decoder Online Free
Encode special characters for URLs or decode percent-encoded strings instantly. Supports query strings, path segments, batch mode, and live preview. Everything runs in your browser.
| Character | Encoded | Notes |
|---|
Percent-encoding done the way the URL spec actually requires, per context
Percent encoding is not one algorithm, it is several, and which one you need depends on where the text is going: a query string, a path segment, or a full URI. This tool exposes that distinction directly with a mode selector rather than pretending one encoding function fits everywhere. It runs entirely on encodeURIComponent and decodeURIComponent, the built-in browser functions, with light logic layered on top for query-string plus signs and per-segment path encoding. No text is sent to a server at any point.
The four encoding modes
encodeURIComponent, which escapes every character except letters, digits, and the unreserved marks - _ . ! ~ * ' ( ). This is the correct choice for a value that will sit inside any part of a URL.
encodeURIComponent first, then replaces every literal %20 with a plus sign. This matches the application/x-www-form-urlencoded convention browsers use for form submissions, where a space becomes + rather than %20.
encodeURIComponent, then rejoins with slashes. This keeps the slash characters that structure the path itself from being escaped into %2F.
decodeURIComponent. If that throws (malformed percent sequences can do this), the tool falls back to decoding only well-formed two-digit hex escapes one at a time, leaving anything malformed untouched instead of failing the whole string.
Why encodeURIComponent instead of encodeURI
JavaScript ships two built in encoders and it is easy to reach for the wrong one. encodeURI assumes you are handing it an entire URL and leaves reserved characters like : / ? # [ ] @ & untouched, since those are structurally meaningful in a full URL. encodeURIComponent assumes you are handing it a single piece, like one query parameter’s value, and escapes those reserved characters too, because inside a component they would otherwise be misread as structure. This tool always uses the component variant, since every mode here is about encoding a piece, not a whole URL.
| Character | encodeURI leaves it alone | encodeURIComponent escapes it |
|---|---|---|
| & | Yes | Yes, to %26 |
| = | Yes | Yes, to %3D |
| / | Yes | Yes, to %2F |
| space | Yes, to %20 | Yes, to %20 |
| – _ . ! ~ * ‘ ( ) | Yes | Yes (both leave these alone) |
decodeURIComponent call throws a URIError on a lone percent sign or an incomplete hex escape like %2. This tool catches that error and falls back to a character-by-character regex replace that only touches well-formed %XX sequences, silently leaving anything else in place. That is convenient for pasting messy real-world URLs, but it means a truly malformed string will decode partially without any warning that part of it was skipped.Two supporting features
Diff highlighting
When enabled, the encoded output is scanned for every %XX triplet and wrapped in a highlight span, giving a fast visual read on exactly which characters were escaped and which passed through unchanged.
Batch mode
A separate textarea processes one URL or string per line, always using full component encoding for the encode direction, useful for converting a list of query values or paths in one pass.
URI standards
- MDN: encodeURIComponent() lists the exact set of characters left unescaped.
- MDN: encodeURI() covers the whole-URL variant and why it escapes fewer characters.
- RFC 3986: Uniform Resource Identifier (URI) Generic Syntax is the specification defining reserved versus unreserved characters that both encoder functions are built around.
- WHATWG URL Standard: application/x-www-form-urlencoded defines the plus-for-space convention used in query string mode.
Where percent encoding bites
Building a query parameter value that contains spaces, ampersands, or non-ASCII characters, decoding a tracking or redirect URL to see its real destination and parameters, preparing a file path segment that contains special characters for use in a REST API route, and debugging why a webhook payload’s URL encoded body is not parsing the way your server expects.
FAQ: URL Encoder Decoder Online
A URL encoder converts special characters like spaces, ampersands, and hashes into percent-encoded sequences (e.g. space becomes %20) so they travel safely in a URL. A URL decoder reverses this, turning %20 back into a space. This tool does both.
encodeURIComponent encodes everything except letters, digits, and the characters – _ . ~ . It is the safest choice for encoding individual query parameters or path values. This URL encoder decoder uses encodeURIComponent by default, which matches what JavaScript’s native function does.
In path segments, a space encodes to %20. In query strings, it can also be represented as a + sign. Use the query string mode in this URL encoder if you are building query parameters. Use full encode mode for paths and fragments.
Yes, completely free with no account or signup required. The URL encoder decoder runs entirely in your browser, so your data never leaves your device.
Characters including spaces, &, =, ?, #, %, +, /, :, @, [ and ] must be percent-encoded when used as data rather than URL structure. Non-ASCII characters like accented letters, Chinese, Arabic, or emoji must also be encoded. The Reference tab in this tool lists every common encoding.
Yes. Switch to Batch Mode, paste one URL per line, choose encode or decode, and click Process All. The results appear in the output area ready to copy. Useful for processing redirect logs or data exports with many encoded URLs.
From the blog
Deep dives on the things these tools touch
Minification, UUID collisions, diffing API responses, and the other questions that come up around this toolset.