URL Encode/Decode

URL Percent-encoding, encode and decode, with support for any text and special characters

Chars: {{ inputText.length }} Bytes: {{ byteCount }}
{{ errorMsg }}

About URL Encoding

URL encoding (also called Percent-encoding) is a mechanism that converts special characters in a URL into a % followed by two hexadecimal digits. Per RFC 3986, a URL may only contain a subset of ASCII characters; other characters (such as Chinese, spaces, and special symbols) must be encoded.

In JavaScript, encodeURIComponent() encodes URL query parameters — it encodes every character except A-Z a-z 0-9 - _ . ! ~ * ' ( ). encodeURI() preserves URL structural characters (such as : / ? # & =).

Common URL encoding scenarios include: AJAX request parameter encoding, handling Chinese in URL paths, and parameter encoding in OAuth signatures.

Examples

Input: Hello, World! → Output: Hello%2C%20World!

FAQ

Q: What is the difference between encodeURIComponent and encodeURI?
A: encodeURI does not encode URL structural characters (:/?#&=+@$), so it is suitable for encoding a full URL; encodeURIComponent encodes more characters and is suitable for encoding query parameter values. This tool uses encodeURIComponent.
Q: Is a space encoded as %20 or +?
A: encodeURIComponent encodes a space as %20. In the application/x-www-form-urlencoded format (such as form submission), spaces are encoded as +. Both are valid.
Q: What is "Encode all" mode?
A: Encode all mode converts every character in the input to %XX format, including ASCII letters and digits. It is useful in special cases, such as when you need to fully hide the URL content.