URL Encoder & Decoder
Free online URL encoder and decoder. Encode URLs with encodeURI or encodeURIComponent. Supports special characters, Chinese, and Unicode. 100% browser-based, no data upload.
How to Use URL Encoder & Decoder
Enter Your URL or Text
Paste or type the URL or text you want to encode or decode into the input box.
Choose Encoding Method
Select encodeURI for complete URLs or encodeURIComponent for URL parameters.
View Instant Results
The encoded or decoded result appears in real-time as you type.
Copy the Result
Click the copy button to copy the result to your clipboard.
encodeURI vs encodeURIComponent
encodeURI
Use for encoding a complete URL.
Preserves: :// ? & = #
https://example.com/path with spaces
Output:
https://example.com/path%20with%20spaces
encodeURIComponent
Use for encoding URL parameters or path segments.
Encodes: :// ? & = # too
param=value&name=test
Output:
param%3Dvalue%26name%3Dtest
Tips for Best Results
- Use encodeURIComponent for individual URL parameters
- Use encodeURI for complete URLs that need safe transmission
- Privacy guaranteed - All processing happens in your browser
- Unicode support - Works with Chinese, Japanese, emoji, and all Unicode characters
URL Encoding Reference Table
Reserved Characters
These characters have special meaning in URLs and may need encoding in certain contexts:
| Character | Encoded | Description |
|---|---|---|
| ! | %21 | Exclamation mark |
| # | %23 | Hash / Fragment |
| $ | %24 | Dollar sign |
| & | %26 | Ampersand |
| ' | %27 | Single quote |
| ( ) | %28 %29 | Parentheses |
| * | %2A | Asterisk |
| + | %2B | Plus sign |
| , | %2C | Comma |
| / | %2F | Forward slash |
| : | %3A | Colon |
| ; | %3B | Semicolon |
| = | %3D | Equals sign |
| ? | %3F | Question mark |
| @ | %40 | At sign |
| [ ] | %5B %5D | Square brackets |
Unsafe Characters
These characters should always be encoded in URLs:
| Character | Encoded | Description |
|---|---|---|
| Space | %20 or + | Space |
| " | %22 | Double quote |
| < > | %3C %3E | Angle brackets |
| { } | %7B %7D | Curly braces |
| | | %7C | Vertical bar |
| \ | %5C | Backslash |
| ^ | %5E | Caret |
| ` | %60 | Backtick |
Safe Characters (Never Encoded)
These characters are always safe and never encoded:
A-Z
a-z
0-9
-
_
.
~
Frequently Asked Questions
URL encoding, also known as percent-encoding, is a mechanism for representing characters in a URL using only the ASCII character set. Characters that are not allowed in URLs (like spaces, Chinese characters, or special symbols) are converted to a % followed by two hexadecimal digits.
encodeURI encodes a complete URL but preserves URL structure characters like ://, ?, &, =, and #. Use it for encoding full URLs.
encodeURIComponent encodes ALL special characters including URL structure characters. Use it for encoding URL parameters or path segments.
Both represent a space, but in different contexts:
- %20 is the standard URL-encoded representation (used in URL paths)
- + is used in query strings (application/x-www-form-urlencoded format)
Our tool uses %20 for consistency with encodeURI/encodeURIComponent.
URL encoding uses UTF-8 by default. Chinese characters are converted to their UTF-8 byte representation, then each byte is encoded as %XX. For example:
- "δΈ" becomes
%E4%B8%AD - "ζ" becomes
%E6%96%87 - "π" becomes
%F0%9F%8E%89
Our tool handles all Unicode characters automatically.
Absolutely! All encoding/decoding happens entirely in your browser using JavaScript. Your URLs are never sent to any server. You can even use this tool offline once the page is loaded.
This usually happens when:
- The original encoding used a different character set (not UTF-8)
- The URL was double-encoded (try decoding multiple times)
- The input wasn't properly encoded in the first place
Yes! Choose the right method:
- Use encodeURI for complete URLs (preserves
://,?,&, etc.) - Use encodeURIComponent for URL parameters only
How URL Encoding Works
URL encoding converts characters into a format that can be transmitted over the Internet. Since URLs can only contain ASCII characters, any character outside this set must be encoded.
The Encoding Process
- Character β UTF-8 Bytes - The character is converted to its UTF-8 byte representation
- Bytes β Hexadecimal - Each byte is converted to a two-digit hexadecimal number
- Hex β Percent-Encoded - A
%prefix is added to each hex number
Example: Encoding "Hello World"
Hello World
Hello%20World
Example: Encoding Chinese Characters
| Character | UTF-8 Bytes | Encoded |
|---|---|---|
| δΈ | E4 B8 AD | %E4%B8%AD |
| ζ | E6 96 87 | %E6%96%87 |
| π | F0 9F 8E 89 | %F0%9F%8E%89 |
Why URL Encoding is Necessary
- URL Specification - URLs are defined in RFC 3986 to use ASCII only
- Reserved Characters - Characters like
?,&,=have special meaning in URLs - Unsafe Characters - Some characters may be misinterpreted or corrupted during transmission
- Internationalization - Non-English characters need encoding for safe transmission
URL Encoding in Different Languages
JavaScript
encodeURI("https://example.com/path with spaces");
// "https://example.com/path%20with%20spaces"
encodeURIComponent("param=value&name=test");
// "param%3Dvalue%26name%3Dtest"
Python
from urllib.parse import quote, quote_plus
quote("path with spaces") # "path%20with%20spaces"
quote_plus("query value") # "query+value"
PHP
urlencode("value with spaces"); // "value+with+spaces"
rawurlencode("path with spaces"); // "path%20with%20spaces"
About URL Encoder & Decoder
Free online URL encoder and decoder. Encode URLs with encodeURI or encodeURIComponent. Supports special characters, Chinese, and Unicode. 100% browser-based, no data upload.