URL Encoder / Decoder
Encode or decode URLs and query strings instantly — supports full URL, component, and form-data encoding modes.
| Parameter | Encoded Value | Decoded Value |
|---|---|---|
Common Percent-Encoded Characters
Quick reference for the characters you'll encounter most often in encoded URLs.
How to Use This Tool
Three ways to encode, decode, and inspect URLs.
encodeURIComponent for parameter values, encodeURI for a full URL, or Form data for HTML form submissions (spaces become +).How URL Encoding Works
The JavaScript functions and RFC 3986 rules behind this tool.
Frequently Asked Questions
Common questions about URL encoding.
RFC 3986 defines "unreserved characters" that are always safe: A–Z a–z 0–9 - _ . ~. These never need to be encoded. "Reserved characters" like / ? # [ ] @ ! $ & ' ( ) * + , ; = have special meaning in URLs and should be encoded when used as data rather than structure. All other characters (spaces, Unicode, etc.) must always be percent-encoded.
Use encodeURI when you have a complete URL and want to make it safe for transmission without breaking its structure (/ and ? stay as-is). Use encodeURIComponent when encoding a single piece of data that will be inserted into a URL — like a query parameter value, a path segment, or a hash fragment. In practice, you'll use encodeURIComponent far more often in JavaScript code.
Both represent a space, but they come from different encoding conventions. %20 is the RFC 3986 standard percent-encoding of a space. The + sign for spaces comes from HTML form encoding (application/x-www-form-urlencoded), which was designed before RFC 3986. When your browser submits a form, it uses + for spaces. When JavaScript uses encodeURIComponent, it uses %20. Both are decoded correctly by most servers, but %20 is safer to use in all contexts.
Yes. Non-ASCII characters are first encoded to UTF-8 bytes, then each byte is percent-encoded. A Chinese character like 中 encodes to %E4%B8%AD (3 bytes). An emoji like 😀 encodes to %F0%9F%98%80 (4 bytes). Modern browsers handle international characters in URLs via internationalized domain names (IDN) and percent-encoding. The tool handles all of these correctly using JavaScript's built-in encoding functions.
This happens when the encoded string uses a non-UTF-8 encoding (like Latin-1 or Windows-1252). JavaScript's decodeURIComponent assumes UTF-8. If the original encoding used a different character set, decoding in a UTF-8 context produces incorrect characters. It can also happen with malformed percent sequences — like %GG (invalid hex digits) or incomplete multi-byte sequences. The tool shows an error when decoding fails due to malformed input.
In most cases, you should only encode the individual parameter values (and sometimes keys), not the whole URL. If you encode the entire URL with encodeURIComponent, you'll turn the ://, ?, and & into their percent-encoded forms, making it an invalid URL. The correct approach: build the URL's base and path normally, then encode only the dynamic values you insert into query parameters using encodeURIComponent.