Skip to content

URL Encoder / Decoder

URLs can only safely contain a specific set of ASCII characters. Anything outside that set — spaces, quotes, curly braces, emoji, non-Latin characters — must be percent-encoded (converted to %XX hex notation). This tool handles both directions: encode plain text for safe URL use, or decode a percent-encoded URL back to readable text.

Why Percent-Encoding Exists

The original URL specification (RFC 1738, later refined by RFC 3986) restricts the unreserved character set to letters, digits, and a small handful of punctuation: -._~. Reserved characters like ?, #, &, /, and = have structural meaning — they delimit the URL's parts. Anything else has to be encoded as the byte's hex value prefixed with a percent sign. A space becomes %20, an emoji becomes a multi-byte UTF-8 sequence like %F0%9F%8E%89, and a Chinese character becomes a three-byte sequence.

The split between unreserved, reserved, and to-be-encoded is the source of most URL bugs. A search query containing a + is a real example: in a URL path, + is unreserved; in a query string, + is interpreted as a space by historical convention. This is why encodeURIComponent encodes + but encodeURI doesn't.

Component vs Whole URI Encoding

Component mode (encodeURIComponent) escapes everything except a small safe set. Use it for individual URL parts like query string values, path segments, or fragment identifiers — anything you're inserting into a URL you're building. Whole URI mode (encodeURI) leaves structural characters (:/?#[]@!$&'()*+,;=) alone. Use it when you have a complete, already-structured URL that just needs its non-ASCII characters escaped.

The decoder reverses both. It accepts a percent-encoded string, parses each %XX sequence as a byte, decodes the byte stream as UTF-8, and returns the result. Malformed sequences (a lone % or invalid hex digits) get reported rather than silently producing garbage.

Common Use Cases

Building a query string by hand when your HTTP library is being uncooperative. Reading a URL from a log file or analytics export where everything has been encoded twice (run the decoder twice). Debugging why a link with an apostrophe in the path is breaking — the answer is almost always that someone forgot to encode it. Pair with the JSON formatter when the encoded URL was part of a JSON-encoded API response, and with the HTML entity encoder when a URL appears inside HTML attribute values.

How We Compare

Every programming language has a URL-encoding function built in: JavaScript's encodeURIComponent, Python's urllib.parse.quote, Ruby's URI.encode_www_form_component. For one-off encoding inside a workflow that doesn't involve writing code, a web tool is faster. Browser extensions like URL Decoder do roughly what this tool does but ship telemetry; this tool runs locally with no telemetry and no upload. For copying-and-pasting between a chat app, a documentation page, and a terminal session, it's the lowest-friction path.

Frequently Asked Questions

What's the difference between encodeURI and encodeURIComponent?+
encodeURIComponent escapes everything that isn't alphanumeric or -_.!~*'() — use it for query string values and individual URL parts. encodeURI preserves URL structure (/ ? # & = +) and only escapes truly unsafe characters — use it on a complete URL you don't want to break.
Why does a space become %20 sometimes and + other times?+
In URL paths, a space is encoded as %20. In query strings using application/x-www-form-urlencoded, spaces become +. Both are valid. encodeURIComponent uses %20 always; decoding accepts both formats.
Can I encode emoji and non-Latin characters?+
Yes. Unicode characters are encoded as UTF-8 byte sequences in percent-encoded form. A single emoji often becomes 9-12 percent-encoded characters because it spans multiple bytes.
Is my URL sent to any server?+
No. All encoding and decoding happens in your browser using native JavaScript functions. No data is transmitted anywhere.
What’s the difference between encodeURI and encodeURIComponent?+
encodeURI preserves URL structure characters (: / ? # & =) so it can encode an entire URL; encodeURIComponent encodes them as percent-codes, so it’s safe for query parameter VALUES but would break a whole URL. The tool offers both modes explicitly.
Why are spaces sometimes %20 and sometimes +?+
%20 is the canonical form everywhere. + is a legacy shorthand used only inside application/x-www-form-urlencoded form data (query strings). Both are valid in their respective contexts.
How do I encode non-ASCII characters?+
They’re encoded as UTF-8 bytes, then each byte is percent-encoded. So "café" becomes "caf%C3%A9". The tool handles this automatically — paste any Unicode text.
Will repeatedly encoding the same string be safe?+
No — double-encoding turns "%20" into "%2520", which is a different value. The tool detects already-encoded input and warns before encoding again. Use the decoder first if unsure.

📖 Learn More

Related Guide URL Encoding and Decoding: Complete Guide →

Built by Derek Giordano \u00B7 Part of Ultimate Design Tools

Privacy Policy \u00B7 Terms of Service