URL Encoder / Decoder
Encode text or query strings so they're safe to use in a URL, or decode a percent-encoded URL back to readable text. Uses encodeURIComponent under the hood, so it handles spaces, ampersands, special characters, and Unicode.
How to use
- Paste the text you want to encode, or the percent-encoded URL you want to decode.
- Click Encode or Decode.
- Copy the result from the output box.
Related tools:
URLs can only contain a limited set of characters. Spaces, special characters, and non-ASCII characters must be percent-encoded - each byte represented as a % followed by two hex digits. A space becomes %20 (or + in form data). The letter A is a safe character; the @ symbol becomes %40.
Encoding is needed when constructing URLs in code that contain user input, query parameters with special characters, or non-English text. Decoding is useful when you receive an encoded URL from an API or log file and need to read what it actually contains. This tool handles both directions using the standard encodeURIComponent / decodeURIComponent rules.
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a complete URL and leaves structural characters (://?&=) unencoded because they are part of the URL structure. encodeURIComponent encodes everything except letters, digits, and - _ . ! ~ * ' ( ), making it safe for encoding individual parameters. Use encodeURIComponent for query parameter values.
Why does a space become %20 in some URLs and + in others?
%20 is the standard percent-encoding for a space in path and query parts. The + sign for spaces is specific to application/x-www-form-urlencoded format (HTML form data). Both decode to a space - but they are technically different encoding conventions.
How do I decode a URL with many %XX sequences in a browser?
Open the browser console and run decodeURIComponent('your-encoded-string'). Or paste it into this tool. Long encoded URLs from redirect chains, analytics, or deep links often need decoding to read the actual destination or parameter values.