← Imperial Products / Tools / URL Encoder & Decoder

URL Encoder & Decoder

Percent-encode URLs or decode them back to readable text. Supports full URL encoding and component encoding. Everything runs in your browser — nothing is uploaded.

Encode URL — preserves :/?#[]@!$&'()*+,;=-._~% (full URL structure intact)  ·  Encode Component — encodes everything except A–Z a–z 0–9 - _ . ! (safe for query params & path segments)
Input
0 chars 0 bytes
Output
0 chars 0 bytes

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed in a URL into a format that can be transmitted over the internet. Each unsafe character is replaced by a percent sign (%) followed by two hexadecimal digits representing the character's byte value.

encodeURI vs encodeURIComponent

Common Characters and Their Encodings

When to Use URL Encoding

More Free Developer Tools

Why URL Encoding Matters

URLs are restricted to a specific subset of ASCII characters. Characters outside that set — including spaces, non-ASCII Unicode characters, and many punctuation marks — must be encoded before they can be safely transmitted in a URL. Without proper encoding, a space in a query parameter breaks the URL structure, an ampersand gets interpreted as a parameter separator, and non-Latin characters cause unpredictable behavior across different browsers and servers. Percent-encoding replaces each unsafe byte with a % followed by the two-character hexadecimal value of that byte — so a space becomes %20, and the copyright symbol © becomes %C2%A9 (its two-byte UTF-8 representation).

Reserved Characters and Why They're Different

Some characters are reserved in URLs because they have structural meaning: ? starts the query string, & separates parameters, = separates keys from values, # starts the fragment, and / separates path segments. When these characters appear as literal data (not structural markers), they must be encoded. This is the key difference between encodeURI and encodeURIComponent: encodeURI assumes you're encoding a complete URL and leaves reserved characters untouched; encodeURIComponent assumes you're encoding a value within a URL and encodes reserved characters too.

Common Pitfalls

The most frequent mistake is using encodeURI when you should use encodeURIComponent. If you're constructing a query string like ?redirect=https://example.com/path?foo=bar, the ? and = in the redirect URL will confuse the parser of the outer URL. You must encode the redirect value with encodeURIComponent first. Another common issue is double-encoding: if a value has already been encoded, encoding it again turns %20 into %2520. Always decode first if you're unsure of the input state. Also note that form submissions encode spaces as + rather than %20 — this is the application/x-www-form-urlencoded format, which is subtly different from standard percent-encoding.

International URLs and IDN

Unicode characters in path segments and query strings are encoded as UTF-8 bytes before being percent-encoded — so the Chinese character 你 becomes %E4%BD%A0. Domain names with international characters use a different system called Internationalized Domain Names (IDN), where characters are encoded using Punycode — for example, münchen.de becomes xn--mnchen-3ya.de. This encoder handles path and query string encoding, not IDN conversion.