URL Encoder / Decoder
Encode URLs for safe transmission or decode percent-encoded URLs back to readable text.
| Character | Encoded | Description |
|---|---|---|
| space | %20 | Space character |
| ! | %21 | Exclamation mark |
| # | %23 | Hash / fragment |
| $ | %24 | Dollar sign |
| & | %26 | Ampersand (param separator) |
| + | %2B | Plus sign |
| / | %2F | Forward slash |
| : | %3A | Colon |
| = | %3D | Equals (key=value) |
| ? | %3F | Question mark |
| @ | %40 | At sign |
| [ | %5B | Left bracket |
| ] | %5D | Right bracket |
What is URL Encoding?
URL encoding (also known as percent-encoding) is a mechanism for encoding special characters in a URL so they can be safely transmitted over the internet. URLs can only be sent over the internet using the ASCII character set. Characters outside this set — as well as reserved characters like &, =, ?, and spaces — must be converted into a valid ASCII format.
Each non-ASCII or reserved character is replaced by a percent sign (%) followed by two hexadecimal digits that represent the character’s byte value. For example, a space becomes %20, and the ampersand & becomes %26.
This tool supports three encoding strategies: encodeURIComponent (best for URL query parameters and path segments), encodeURI (preserves full URL structure), and form encoding (replaces spaces with + for HTML form submissions).
How to Use This Tool
Using the URL Encoder / Decoder is straightforward:
To Encode: Select the “Encode” tab, choose your encoding type from the dropdown (encodeURIComponent is recommended for query parameters), then paste or type your text or URL in the input box. The encoded result appears instantly below.
To Decode: Switch to the “Decode” tab, choose the decode method (use “Auto-detect” if unsure), and paste your percent-encoded URL. The human-readable version will appear immediately.
You can also use the ⇅ Swap button to move the output back into the input field for further processing, and the Copy button to copy results to your clipboard. The character mapping table shows exactly which characters were transformed.
Common Use Cases
API Development: When building REST APIs, query string values must be encoded so characters like &, =, and spaces don’t break the URL structure.
Web Development: Encoding form data, constructing dynamic URLs in JavaScript, or embedding URLs inside other URLs (like redirect parameters).
Debugging: Decoding percent-encoded URLs in server logs, network inspector output, or email links to understand what data is being passed.
Internationalization: Encoding non-Latin characters (Arabic, Chinese, emoji, etc.) for use in URLs, which ensures compatibility across all browsers and servers.
Security: Properly encoding user input before including it in URLs helps prevent injection attacks and ensures data integrity in web applications.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI is designed for encoding a complete URL — it leaves characters like :, /, ?, and # intact because they are meaningful in a full URL. encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ), making it ideal for encoding individual query parameter values or path segments that might contain those special characters.
When should I use form encoding (space → +)?
Form encoding (also called application/x-www-form-urlencoded) is used when submitting HTML form data via GET or POST. In this format, spaces are replaced with + instead of %20. You’d also see this in traditional web form submissions and some older APIs. Modern APIs typically prefer %20 for spaces.
Why does my URL contain %XX sequences?
Those %XX sequences are percent-encoded characters. Each XX is a hexadecimal byte value. For example, %20 is a space (hex 20 = decimal 32), %3D is =, and %2F is /. Use the Decode tab of this tool to convert them back to readable text.
Can I encode non-English characters like Arabic or Chinese?
Yes. Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, the Chinese character 你 encodes to %E4%BD%A0. This tool handles all Unicode characters including emoji, Arabic, Chinese, Cyrillic, and more.
Is it safe to decode any percent-encoded URL?
Decoding a URL is generally safe for reading purposes. However, be cautious about decoding URLs before passing them to a browser or server — some security mechanisms rely on encoded values staying encoded (e.g., to prevent path traversal attacks). Always validate decoded values before using them in application logic.
What happens if I try to decode an invalid percent-encoded string?
If the string contains invalid percent sequences (like %GG or a lone %), the decoder will throw an error. This tool catches those errors and shows a descriptive message so you know what went wrong, rather than silently failing or showing corrupt output.
