URL Encoder Decoder Online

🔗 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. Safe characters (letters, digits, -, _, ., ~) are never encoded.
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.
Decode Plus signs are converted back to spaces before calling 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.
// 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. This tool always uses the component variant, since every mode here is about encoding a piece, not a whole URL.

CharacterencodeURI leaves it aloneencodeURIComponent escapes it
&YesYes, to %26
=YesYes, to %3D
/YesYes, to %2F
spaceYes, to %20Yes, to %20
– _ . ! ~ * ‘ ( )YesYes (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 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.

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.

Privacy Overview

Cookies let this site remember your preferences and show us which tools people actually use. Full detail sits in our Privacy Policy.