~/devtools / url
tool::url

URL
Encoder

Encode or decode URL strings. Choose between encodeURIComponent (encodes everything) and encodeURI (preserves URL structure).

ad · 728×90
Input
Output
// encode vs encodeURI
encodeURIComponentEncodes everything except A-Z a-z 0-9 - _ . ! ~ * ' ( )
encodeURIPreserves URL chars: : / ? # [ ] @ ! $ & ' ( ) * + , ; =
decodedecodeURIComponent — decodes any %XX sequences
ad · 300×250
// about this tool

What is URL Encoding?

URLs are restricted to a limited set of characters. Characters outside the ASCII range — such as Korean/Japanese text, special characters, and spaces — must be converted to percent-encoded format (%XX) to be safely included in a URL.

JavaScript provides two encoding functions. encodeURIComponent encodes nearly all special characters including URL structure characters (colon, slash, question mark, etc.) and is suitable for query parameter values. encodeURI preserves the overall URL structure.

This tool supports three modes: encodeURIComponent, encodeURI, and decode. It is useful for building API query parameters, debugging URL issues, and handling non-ASCII characters in URLs.

Use Cases
  • Include Korean, Japanese, or other non-ASCII characters in URL query parameters
  • Debug URL parameter encoding errors in API requests
  • Handle special characters in email links and share URLs
  • Decode percent-encoded URLs into human-readable form
  • Handle nested URL encoding for OAuth redirect_uri parameters
FAQ
Q. What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent also encodes URL structure characters like :, /, ?, #, =, and &. Use it for query parameter values. encodeURI leaves those characters intact, making it suitable for encoding an entire URL.
Q. Is a space encoded as %20 or +?
encodeURIComponent encodes spaces as %20. HTML form submissions (application/x-www-form-urlencoded) use + for spaces. Using %20 is safer for most APIs.
Q. What happens if I encode an already-encoded URL?
The % character gets double-encoded as %25, which breaks the URL. Use decode mode first to check the current state of the URL, then re-encode only if necessary.
// related tools
b64
Base64 Encoder
Encode and decode Base64 strings. Supports text, URLs, and binary data.
\u
Unicode Converter
Bidirectional text ↔ \uXXXX unicode escape conversion. Supports Java .properties native2ascii format.
<
HTML Entity Encoder
Encode HTML special characters into entities or decode them. & → & and more.
{}
JSON Formatter
Format, validate, and minify JSON. Supports nested structures and diff comparison.