URL Encoder / Decoder
Encode or decode URL percent-encoding. Switch between encodeURI and encodeURIComponent with inline help.
Quick answer: Encode or decode URL percent-encoding. Switch between encodeURI and encodeURIComponent with inline help.
Last updated
Frequently asked questions
- What is URL encoding?
- URL encoding (percent-encoding) replaces unsafe characters with %XX sequences so they can travel safely in a URL. A space becomes %20, an ampersand becomes %26, and so on.
- Why do URLs show %20?
- Because spaces aren't allowed in URLs. Browsers and servers encode each space as %20 (the hex code for space) so the URL stays valid in transit.
- How do I encode spaces in a URL?
- Paste your text, pick Encode, and spaces become %20 (or + when used in form data). Both are valid — %20 works in any URL position.
- What characters must be URL-encoded?
- Spaces, non-ASCII characters, and reserved characters when used outside their reserved role: ! # $ & ' ( ) * + , / : ; = ? @ [ ]. The tool handles all of them automatically.
- What's the difference between encodeURI and encodeURIComponent?
- encodeURI preserves URL-structural characters (/ ? & = #) so it's safe for whole URLs. encodeURIComponent encodes everything except letters, digits and a few safe chars — use it for parameter values.
- How do I decode a URL-encoded string?
- Paste the encoded string, pick Decode, and the readable version appears. The decoder handles both %20 and + for spaces.
- Is URL encoding the same as Base64?
- No. URL encoding makes text URL-safe by replacing a few characters; Base64 transforms binary data into ASCII for transmission. Use Base64 for binary, URL encoding for URL parameters.
- Can I encode a full URL with parameters?
- Use encodeURI for the whole URL (it preserves ? & = / so the URL still works). Use encodeURIComponent on each parameter value before assembling the URL.
- Why is my URL double-encoded?
- Double encoding (e.g. %2520 instead of %20) happens when an already-encoded URL is encoded again. Decode it twice to recover the original, and check your code for an extra encode call.
- Is URL encoding safe for passwords?
- No — URL encoding is not encryption. Anyone seeing the URL can decode it instantly. Never put passwords in URLs; use POST bodies or HTTP headers instead.