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
Built by Derek Giordano \u00B7 Part of Ultimate Design Tools
Privacy Policy \u00B7 Terms of Service