URL Encode/Decode
Encode and decode text for safe use in a URL, using the browser's native functions.
Component vs. full URL
"Component" (encodeURIComponent) escapes every special character — use it for a value you're inserting into a URL, like a query parameter. "Full URL" (encodeURI) doesn't escape the characters that are part of a URL's own syntax (: / ? # &) — use it when the text is already an entire URL.
Privacy
The encoding happens in your browser using JavaScript's native functions. The text is never sent to Numelto.
Encoding examples
If the value comes from data encoded in another format, see Base64.
| Text | Encoded (component) |
|---|---|
| café & tea | caf%C3%A9%20%26%20tea |
| a/b?c=d | a%2Fb%3Fc%3Dd |
When you need to encode a URL
Encoding is needed when a value (a search parameter, an email, a space or an accented character) becomes part of the URL, because those characters aren't valid as-is in a web address and could break the link or be misinterpreted.