🔗 Developer Tools ✔ Free Forever

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.

✔ Encode & decode URLs ✔ Query string + path modes ✔ Live encode toggle ✔ Batch URL processing ✔ Highlight % sequences ✔ 100% browser based
Input
Try: URL with spaces Query params Encoded URL
output
Result
Paste URLs (one per line)
Results
Common URL encoding rules Spaces become %20 (or + in query strings). Special characters like &, =, ?, #, /, : are encoded in most contexts. Letters, digits and - _ . ~ ! * ' ( ) are never encoded by this tool. A server may also accept %21 %2A %27 %28 %29 for the last five.
CharacterEncodedNotes
About This Tool

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

Full / Component A direct call to 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.
Query string Runs 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.
Path Splits the input on forward slashes, encodes each segment independently with encodeURIComponent, then rejoins with slashes. This keeps the slash characters that structure the path itself from being escaped into %2F.
Whole URL Calls 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.
Decode In Query string mode, plus signs become spaces before 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.
// mode dispatch and the query-string plus-sign convention function encodeURL(str, mode) { if (mode === 'query') { return encodeURIComponent(str).replace(/%20/g, '+'); } if (mode === 'path') { return str.split('/').map(function(seg){ return encodeURIComponent(seg); }).join('/'); } return encodeURIComponent(str); }

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.

CharacterencodeURI leaves it aloneencodeURIComponent escapes it
&YesYes, to %26
=YesYes, to %3D
/YesYes, to %2F
spaceNo, encodes to %20Yes, to %20
- _ . ! ~ * ' ( )YesNo (both leave these alone)
Decoding never throws, even on malformed input. A plain 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.

encodeURIComponent / decodeURIComponent Query string plus-sign convention Per-segment path encoding Graceful malformed-input fallback

URI standards

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.

Common Questions

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.