Free URL Encoder / Decoder

Encode special characters for safe use in URLs or decode percent-encoded strings back to readable text. Uses standard percent-encoding (RFC 3986).

Output
Input Length
Output Length

Common Encodings

CharacterEncodedCharacterEncoded
Space%20&%26
=%3D?%3F
/%2F#%23
@%40+%2B

What Is URL Encoding?

URL encoding (also called percent-encoding) replaces unsafe or special characters in a URL with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII value. For example, a space becomes %20, and an ampersand (&) becomes %26. This ensures that special characters do not break the URL structure.

URLs can only contain a limited set of ASCII characters. Characters like spaces, &, =, ?, /, #, and non-ASCII characters (accented letters, Chinese characters, emojis) must be encoded to be safely included in a URL. Without encoding, these characters could be misinterpreted as URL delimiters or cause parsing errors.

encodeURIComponent vs encodeURI

JavaScript provides two encoding functions. encodeURIComponent() encodes everything except letters, digits, and a few special characters (- _ . ! ~ * ' ( )). It is used for encoding URL parameter values. encodeURI() preserves the URL structure characters (:, /, ?, #, &, =) and only encodes characters that are not valid anywhere in a URL. This tool uses encodeURIComponent for the most thorough encoding.

Proper URL encoding is essential for building API requests, constructing query strings, embedding user input in URLs, and ensuring web applications handle special characters correctly across all browsers and servers.

More Security Tools

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI() is designed for encoding a complete URL — it preserves characters like ://?#&= that are part of URL structure. encodeURIComponent() encodes everything except letters, digits, and - _ . ! ~ * ' ( ), making it suitable for encoding parameter values. This tool uses encodeURIComponent for thorough encoding.
Why do I need to URL-encode data?
URLs have a strict syntax where certain characters (like &, =, ?, #) have special meaning. If your data contains these characters, they will be misinterpreted as URL structure. Encoding converts them to safe percent-encoded sequences, preserving the data's integrity when transmitted via URL.
Is %20 the same as +?
In standard URL encoding (RFC 3986), a space is encoded as %20. In HTML form submissions (application/x-www-form-urlencoded), a space is encoded as +. Both represent a space, but %20 is the universal standard. This tool uses %20 via encodeURIComponent.
Can I encode non-English characters?
Yes. encodeURIComponent handles all Unicode characters by first encoding them as UTF-8 bytes, then percent-encoding each byte. For example, the character ñ becomes %C3%B1 (its UTF-8 byte sequence). This works for all languages, including CJK characters and emojis.
When should I decode a URL?
Decode URLs when you receive percent-encoded data and need to read the original values — for example, when parsing query parameters from a URL, reading URL-encoded form data, or debugging API requests. The decoded output shows the human-readable text that was originally encoded.