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.
encodeURI, which keeps : / ? # & = and the other reserved characters as they are and only escapes spaces, non-ASCII text and characters that are never allowed in a URL. Use it for a full link you want to make valid without breaking it apart.
decodeURIComponent runs. In the other modes a plus stays a plus. If decoding throws on a malformed sequence, the tool decodes each well-formed run of %XX escapes on its own, leaves the broken parts untouched and tells you how many it skipped.
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. Most modes here use the component variant, because they encode a piece. When you paste a complete address, pick Whole URL mode and the tool uses encodeURI so the structure stays readable.
| Character | encodeURI leaves it alone | encodeURIComponent escapes it |
|---|---|---|
| & | Yes | Yes, to %26 |
| = | Yes | Yes, to %3D |
| / | Yes | Yes, to %2F |
| space | No, encodes to %20 | Yes, to %20 |
| - _ . ! ~ * ' ( ) | Yes | No (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 decodes each run of well-formed %XX sequences on its own, so multi-byte characters like € still come out right. Anything malformed stays in place, and a note under the result tells you how many sequences could not be decoded.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, using the encoding mode you pick. Copy the results or download them as a text file. It is handy 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.