How to use
- Enter the text you want to encode or decode.
- Click "Encode" or "Decode".
- Use the copy button to grab the result.
π― Use Cases
- Include non-ASCII or special characters in a URL query parameter β safely encode search terms or names into a querystring
- Verify the URL encoding of an API request β prevent reserved characters like & = ? from breaking a request when mixed into a parameter value
- Decode a mangled URL-encoded string β restore a %XX-encoded string left in a log or email back to readable text
- Safely embed special characters in email or social share links β build links with spaces or symbols in the title/description without breaking them
Example
https://example.com/κ²μ?q=μλ νμΈμ
https%3A%2F%2Fexample.com%2F%EA%B2%80%EC%83%89%3Fq%3D%EC%95%88%EB%85%95%ED%95%98%EC%84%B8%EC%9A%94
Clicking "Encode" percent-encodes every reserved symbol (colon, slash, question mark) and each non-ASCII character as %XX. Because these Korean characters are 3 bytes each in UTF-8, they become three %XX pairs apiece. Running "Decode" on the output restores the original string.
encodeURI vs. encodeURIComponent
JavaScript has two URL-encoding functions. This tool uses encodeURIComponent, which is meant for encoding a single "piece" of a URL β like a query parameter value β rather than a whole URL, so it also encodes delimiter characters like : / ? & =.
| Function | Characters preserved | When to use |
|---|---|---|
| encodeURI | Preserves URL delimiters like : / ? # [ ] @ & = + $ , ; | Encoding a complete, full URL |
| encodeURIComponent (this tool) | Only preserves - _ . ! ~ * ' ( ), encodes everything else | Encoding a single piece β e.g. a query parameter value |
For example, encodeURI("https://a.com/search?q=1&2") leaves & and ? untouched, while encodeURIComponent encodes &, ?, and / as well. Always use encodeURIComponent when encoding a single query parameter value, so an unencoded & doesn't get mistaken for a separator between parameters.
FAQ
- Is what I type sent to a server?
- No. It's processed using the browser's built-in encodeURIComponent/decodeURIComponent functions.
- Which characters get encoded?
- Every character except letters, digits, and a handful of special characters (-_.!~*'()) is encoded as %XX.
- Does a space get encoded as %20 or +?
- This tool encodes spaces as %20. A + only means "space" in application/x-www-form-urlencoded (HTML form submissions) β %20 is the standard for URL paths and query parameters.
- What if decoding fails with an error?
- An error message appears if the input contains a malformed % escape sequence. Check that the original encoded string is intact.