URL Encoder Decoder - Encode and Decode URLs Online
Free online URL encoder and decoder. Encode URLs using percent encoding and decode encoded URLs instantly.
More Tools
What is URL Encoding?
URL encoding (also called percent encoding) is a mechanism for encoding information in a Uniform Resource Identifier (URI) under certain circumstances. It converts characters into a format that can be transmitted over the Internet. Characters that are not allowed in URLs are replaced with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code. For example, spaces become %20, and @ becomes %40.
Why URLs Need Encoding
URLs can only contain certain characters from the ASCII character set. Reserved characters like spaces, quotation marks, ampersands, and non-ASCII characters (such as Chinese, Japanese, or emoji) must be encoded to ensure they are correctly transmitted. URL encoding replaces unsafe characters with their percent-encoded equivalents, making URLs safe for use in web addresses, query parameters, and API requests. Non-ASCII characters such as Chinese text or emoji are encoded as their UTF-8 byte sequences.
Percent Encoding Examples
| Character | Encoded |
|---|---|
| %20 | |
| @ | %40 |
| # | %23 |
| & | %26 |
| 你好 | %E4%BD%A0%E5%A5%BD |
| % | %25 |
| + | %2B |
| / | %2F |
| ? | %3F |
| = | %3D |
| 😀 | %F0%9F%98%80 |
How to Use URL Encoder Decoder
- 1
Paste your URL or text into the input area
- 2
Click "Encode" to convert special characters to percent-encoded format
- 3
Click "Decode" to convert percent-encoded URLs back to readable text
- 4
Use "Copy" to copy the result or "Clear" to start over
Frequently Asked Questions
What is percent encoding?
Percent encoding is a method of encoding characters in URLs by replacing unsafe characters with a % symbol followed by two hexadecimal digits. For example, a space character is encoded as %20, because 20 is the hexadecimal value for the space character's ASCII code (32 in decimal).
What is the difference between encodeURI and encodeURIComponent?
encodeURI is designed to encode an entire URL and preserves characters that have meaning in the URL structure (like /, ?, &, =). encodeURIComponent encodes individual URL components (like query parameter values) and encodes all special characters including /, ?, &, =. Our tool uses encodeURIComponent for comprehensive encoding.
When should I use URL encoding?
You should use URL encoding whenever you include special characters in URLs, especially in query parameters, path segments with spaces or non-ASCII characters, and when programmatically constructing URLs from user input. Proper encoding ensures your URLs remain valid and data is transmitted correctly.
Is my data sent to a server?
No. All encoding and decoding happens entirely in your browser using JavaScript. Your data never leaves your device — we do not upload, store, or share any data. Your privacy is fully protected.
Why is a space encoded as %20 in URLs but as + in form data?
URLs and HTML forms use two different encoding rules. In URLs, percent encoding (RFC 3986) represents a space as %20. In HTML form submissions with the application/x-www-form-urlencoded media type, a space is encoded as a plus sign (+). If you build query strings manually, use %20 for raw URLs and + only for classic form posts — better yet, let encodeURIComponent or a URL library handle it for you.
How do I URL encode a string in Python?
Python's urllib.parse module provides quote() and quote_plus(). quote('hello world') returns 'hello%20world' (URL encoding), while quote_plus() returns 'hello+world' (form encoding). For building query strings, use urllib.parse.urlencode(). In JavaScript, use encodeURIComponent(); in PHP, use rawurlencode().
Can URL encoding handle emoji and other Unicode characters?
Yes. Non-ASCII characters like emoji, Chinese or accented letters are first converted to their UTF-8 bytes, and each byte is then percent-encoded. For example, the emoji 😀 becomes %F0%9F%98%80. The result is valid in any URL and decodes back to the original character.
Found an issue with this tool?
Report a problem