URL Encoder & Decoder
Percent-encode text for safe use in a URL, or decode an encoded string back to readable text. Handles spaces, ampersands, question marks and full Unicode. Both directions run in your browser using the standard encodeURIComponent, so a URL with a token in it stays private.
Runs in your browser — nothing is uploaded
Questions
- What is the difference between encodeURI and encodeURIComponent?
- encodeURI leaves the characters that structure a URL alone — :/?&= — so it is for encoding a whole URL. encodeURIComponent encodes those too, which is what you need for a single query-string value. Using the wrong one is why a URL passed as a parameter breaks the link it is inside.
- Why does a space become %20 sometimes and + other times?
- %20 is the correct percent-encoding for a space anywhere in a URL. The plus sign means a space only inside an application/x-www-form-urlencoded form body — the legacy HTML form encoding. Use %20 unless you are specifically building a form body.
- Does it handle non-English characters?
- Yes. Unicode characters are encoded as their UTF-8 bytes, so é becomes %C3%A9 — two bytes, two escapes. That is the correct modern behaviour and what every current server expects.