URL Encoding Explained — When and How to Encode
Encode text for safe use in URLs or decode percent-encoded strings instantly in your browser.
Try URL Encoder & Decoder free →
The problem
You're building a URL with query parameters and one of the values has spaces, ampersands, or unicode characters. If you don't encode it, the URL breaks — the browser or server misparses it and you get a 400 or the wrong value. Or you're reading a log file full of %20 and %3D and you just want to see the actual text. You could open the browser console and type encodeURIComponent(), but you have to remember whether that's the right function or if you need encodeURI() — they handle different characters.
How it works
- Paste a string or full URL into the input.
- Click Encode or Decode. Spaces become
%20, special characters become percent-encoded sequences — or the reverse. - Copy the result. One click to clipboard.
Your data never leaves your browser. All processing happens locally.
When to use this tool
Building query strings by hand, debugging URLs in server logs, encoding redirect URIs for OAuth flows, checking what a garbled URL actually says, or any time you need to safely pass a value as a URL parameter without breaking the structure of the URL.
Why I built it
URL encoding is one of those things I do often enough to need a tool, but not often enough to remember that encodeURIComponent and encodeURI handle different characters. Having it in a tab is faster than opening a console, and I don't have to think about whether my input is going to a server.
Tips and reference
Characters that must be encoded in URL query parameters:
| Character | Encoded | Notes |
|---|---|---|
| (space) | %20 | Also + in HTML form data |
| & | %26 | Separates query parameters |
| = | %3D | Key-value separator |
| ? | %3F | Starts the query string |
| # | %23 | Fragment identifier |
| / | %2F | Path separator |
| @ | %40 | Used in email addresses and userinfo |
| + | %2B | Literal plus sign (unencoded + means space in forms) |
| % | %25 | The escape character itself |
When in doubt, encode the value — most decoders handle over-encoding gracefully, but under-encoding breaks parsing.
Built with vanilla HTML/JS. No frameworks, no backend, loads instantly.