πŸ”— Online URL Encoder & Decoder

Ad Space - Top (728x90)

Input Text

Shortcuts: Ctrl+Enter Encode | Ctrl+Shift+D Decode | Ctrl+Shift+S Swap

Result

Result will appear here...
Ad Space - Middle (728x90)

URL Encoding Knowledge

What is URL Encoding?

URL encoding (also known as percent-encoding) is a mechanism that converts special characters in a URL into the %XX format, where XX is the hexadecimal representation of the character's ASCII/UTF-8 byte. The URL standard is defined in RFC 3986, which specifies that URLs may only contain ASCII letters, digits, and a few reserved characters. All other characters must be encoded.

When Do You Need URL Encoding?

encodeURI vs encodeURIComponent

JavaScript provides two URL encoding functions. The core difference is how they handle reserved characters:

β€’ encodeURI: Encodes a complete URL, preserving structural characters ; , / ? : @ & = + $ #. Use this when encoding a full URL address.

β€’ encodeURIComponent: Encodes a URL component (such as a parameter value), encoding all reserved characters, ensuring that special characters in the value do not break the URL structure.

Simple rule: Use encodeURI for entire URLs, use encodeURIComponent for parameter values.

URL Encoding Reserved Character Table

Character TypeCharactersencodeURIencodeURIComponent
AlphanumericA-Z a-z 0-9PreservedPreserved
Unreserved symbols- _ . ! ~ * ' ( )PreservedPreserved
URL structure chars; , / ? : @ & = + $ #PreservedEncoded as %XX
Space(space)Encoded as %20Encoded as %20
Unicode charse.g. CJKEncoded as %XXEncoded as %XX
Other special chars< > " { } | \ ^ `Encoded as %XXEncoded as %XX

Common Use Cases

How much does URL encoding increase length?

Each encoded character becomes 3 characters (e.g. a space becomes %20). Characters that occupy multiple bytes in UTF-8 will expand further β€” for example, a 3-byte CJK character becomes 9 characters after encoding. URLs containing many non-ASCII or special characters will increase significantly in length after encoding.

Should I choose encodeURI or encodeURIComponent?

If you are encoding an entire URL (with protocol, domain, path), use encodeURI, which preserves :/?#&= and other structural characters. If you are encoding a specific parameter value or fragment within a URL, use encodeURIComponent, which encodes all special characters to prevent them from breaking the URL structure.

Does URL encoding support Chinese/Unicode?

Yes. JavaScript's encodeURI and encodeURIComponent automatically convert Unicode characters to percent-encoding using UTF-8. This tool fully supports Chinese, Emoji, and all Unicode characters.

What is a space encoded as? What is the difference between %20 and +?

encodeURI and encodeURIComponent encode a space as %20. In the application/x-www-form-urlencoded format (such as form submissions), a space is encoded as +. This tool uses the standard %20 encoding. If you need + encoding, you can replace it manually.

How do I use batch mode?

After checking "Batch mode", the tool processes each line in the input box separately, one URL per line. Empty lines are preserved. If a line fails to decode, an error message is shown for that line without affecting other lines.

Is URL encoding encryption? Is it secure?

No. URL encoding is an encoding scheme, not encryption. Anyone can decode it and it provides no security. Its purpose is to ensure that special characters in URLs are correctly transmitted and parsed, not to protect data. For secure transmission, use HTTPS or a real encryption algorithm.

Ad Space - Bottom (728x90)