📖 What is URL Encoder/Decoder?
URL encoding (also called percent-encoding) replaces unsafe characters in a URL with a % followed by two hex digits. For example, a space becomes %20 and an ampersand becomes %26. This is required because URLs can only contain a limited set of ASCII characters — anything outside that set (spaces, Unicode, special symbols) must be encoded to be transmitted correctly.
This tool encodes text using JavaScript's encodeURIComponent(), which is the standard for encoding query parameters. It also decodes percent-encoded URLs back to readable text. Everything runs in your browser — your URLs are never sent to a server.
💡 Example
Input
https://example.com/search?q=hello world&lang=日本語
Output
https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3D%E6%97%A5%E6%9C%AC%E8%AA%9E
🛠️ Common Use Cases
- Encoding query string parameters that contain spaces, ampersands or special characters
- Encoding non-ASCII characters (Unicode, accented letters, CJK) in URLs
- Debugging API requests where parameters arrive garbled or double-encoded
- Building OAuth signature base strings that require strict percent-encoding
- Preparing
mailto: links with pre-filled subject and body text
📝 encodeURI vs encodeURIComponent
encodeURI() encodes a full URL but leaves characters like :, /, ?, & and = intact — it assumes the URL structure is already correct. encodeURIComponent() encodes everything except letters, digits, and - _ . ~ — use it for individual parameter values.
Rule of thumb: use encodeURIComponent() for values you are inserting into a URL, and encodeURI() only when encoding an entire URL that is already well-formed.
⚠️ Common Mistakes
- Double encoding — encoding an already-encoded URL turns
%20 into %2520. Decode first, then re-encode if needed.
- Using encodeURI for parameter values — it leaves
& and = unencoded, which breaks query strings
- Forgetting to encode the
+ sign — in query strings, + means space; if your data contains a literal +, it must be encoded as %2B
- Encoding the entire URL when only a parameter needs it — encoding
https:// breaks the URL
❓ Frequently Asked Questions
What is the difference between %20 and + for spaces? ▾
In URL query strings (after the ?), + and %20 both represent a space. The + convention comes from HTML form encoding (application/x-www-form-urlencoded). In URL paths (before the ?), only %20 is valid — a literal + stays as a plus sign.
Do I need to encode UTF-8 characters in URLs? ▾
Yes — any character outside the ASCII safe set must be percent-encoded. Modern browsers display decoded Unicode in the address bar, but the actual HTTP request uses the encoded form. This tool handles UTF-8 encoding automatically.
Why does my API return garbled text? ▾
Usually double encoding: the URL was encoded twice, so the server sees literal %25 characters instead of decoded values. Decode the URL with this tool to check, and make sure your code encodes exactly once.
Is my data private? ▾
Yes — all processing runs entirely in your browser using JavaScript. Your data is never sent to any server.
Is this tool free? ▾
Completely free — no login, no usage limits, and it works offline once the page is loaded.
Yes — completely free, no login required, no usage limits.
Is my data private? ▾
Yes — all processing runs in your browser. Your data is never sent to any server.
Does it work offline? ▾
Yes — once the page is loaded, the tool works without an internet connection.