Encode special characters for URLs or decode percent-encoded strings back to readable text. Runs in your browser.
Try it
Encode vs Encode Component β whatβs the difference?
encodeURI("https://example.com/path?q=hello world&lang=en")
// β "https://example.com/path?q=hello%20world&lang=en"
// Keeps :, /, ?, &, = intact
encodeURIComponent("hello world&lang=en")
// β "hello%20world%26lang%3Den"
// Encodes EVERYTHING except letters, digits, - _ . ~
Use encodeURI for full URLs. Use encodeURIComponent for individual query parameter values.
Common encoded characters
| Character | Encoded | Why |
|---|---|---|
| (space) | %20 | Not allowed in URLs |
& | %26 | Separates query params |
= | %3D | Separates key=value |
? | %3F | Starts query string |
# | %23 | Fragment identifier |
/ | %2F | Path separator |
@ | %40 | Used in email/auth |