URL Encode/Decode
Encode or decode special characters in URLs for safe transmission.
URLs can only contain a limited set of characters. Anything outside that set - spaces, &, #, non-English characters - needs to be percent-encoded first. Paste your text or URL above to encode or decode it instantly.
How URL Encoding Works
URL encoding (officially called percent-encoding) replaces unsafe characters with a % sign followed by two hex digits. A space becomes %20. An ampersand becomes %26. A question mark becomes %3F. This makes sure URLs work correctly across every browser and server without any characters being misinterpreted.
Characters That Must Be Encoded
- Spaces - become %20 (or + in form submissions)
- Reserved characters - ! # $ & ' ( ) * + , / : ; = ? @ [ ] all have special meaning in URLs
- Non-ASCII characters - accented letters, Chinese characters, emojis and everything outside basic ASCII
- The percent sign itself - % becomes %25 (otherwise it looks like the start of an encoded sequence)
The %20 vs + Question
This confuses a lot of people. In URL paths, spaces should always be %20. In HTML form data (application/x-www-form-urlencoded), the + sign represents a space. Most web frameworks handle this automatically, but if you're building URLs manually, stick with %20 since it works everywhere.
Watch Out for Double Encoding
Double encoding is one of the most common bugs in web development. It happens when you encode a string that's already been encoded. So %20 becomes %2520 because the % gets encoded again to %25. The fix is simple: only encode your data once, right before you put it in a URL. Never encode a full URL that already contains encoded characters.
encodeURI vs encodeURIComponent in JavaScript
These two functions are easy to mix up. encodeURI is for encoding a complete URL. It leaves characters like / : ? # alone because they are structural parts of a URL. encodeURIComponent is for encoding a single value that goes inside a URL, like a query parameter. It encodes everything except letters, numbers and a few special chars (- _ . ~). When in doubt, use encodeURIComponent for values and encodeURI for whole URLs.
How to Use
- Paste your text or URL into the input area.
- Click Encode to convert special characters to percent-encoded format.
- Click Decode to turn percent-encoded strings back into readable text.
- Copy the result.
Frequently Asked Questions
How do I use URL Encode and Decode?
Paste a URL or text value and choose encode or decode. Use encoding before placing text inside a query string. Use decoding when you need to read percent-encoded values.
What does URL encoding do?
It replaces unsafe characters with percent codes so the URL can travel correctly through browsers and servers. Spaces, symbols and non-English characters often need encoding.
What is the difference between `%20` and `+`?
`%20` is standard percent encoding for a space. `+` is common in form-encoded query strings. Both can mean a space, but they are used in different contexts.
Should I encode the whole URL or only a parameter?
Usually encode only the parameter value. Encoding a full URL can break slashes, question marks and other structure. If the URL stops working, check whether too much was encoded.
Why does decoded text still look broken?
The original encoding may have been wrong, incomplete or applied more than once. Decode step by step and stop when the text becomes readable. Do not keep decoding blindly.