URL Encoder / Decoder
Encode and decode URLs and query strings.
Common URL-Encoded Characters
What Is URL Encoding?
URL encoding (also called percent-encoding) converts characters into a format that can be safely transmitted in a URL. URLs can only contain a limited set of ASCII characters. Special characters like spaces, ampersands, and non-ASCII characters must be encoded using a percent sign followed by their hexadecimal value (e.g., space becomes %20).
Why Encode URLs?
URLs have reserved characters that serve specific purposes: ? starts query strings, & separates parameters, # denotes fragments, and = assigns values. If your data contains these characters, they must be encoded to prevent misinterpretation. Without encoding, a search query containing "&" would break the URL structure.
encodeURI vs encodeURIComponent
JavaScript provides two encoding functions. encodeURI() encodes a full URL, preserving scheme, domain, path separators, and query delimiters. encodeURIComponent() encodes everything — use it for individual query parameter values. Using the wrong function is one of the most common URL encoding bugs in web development.
International Characters in URLs
Non-ASCII characters in domain names use Punycode (IDN), while non-ASCII characters in paths and queries use UTF-8 percent-encoding. For example, "café" becomes "caf%C3%A9". Modern browsers display decoded international characters in the address bar but send encoded versions in HTTP requests.
Common Encoding Issues
Double-encoding is a frequent mistake — encoding an already-encoded string turns %20 into %2520. This happens when multiple layers of software each apply encoding. Always decode first if you're unsure whether input is already encoded. Our tool handles both directions cleanly to help you debug encoding issues.