How to use the URL Encoder and Decoder
- Choose Encode or Decode, then pick a style: Component for a single value, Full URL for a complete link, or Form for HTML form data.
- Paste your text or URL into the left box. The converted result appears on the right instantly.
- Tick Process each line separately to convert a whole list of values or links in one go.
- If you paste a full URL, check the breakdown below to see the protocol, host, path and each decoded query parameter.
Features
- Three encoding styles: encodeURIComponent, encodeURI and form encoding
- Batch mode that converts every line on its own
- URL breakdown with a decoded query-parameter table
- Full UTF-8 support for accents, emoji and non-Latin scripts
- Explains malformed escapes such as a stray % sign
- Runs locally, so private links and tokens stay on your device
Why URLs need encoding
A URL may only contain a limited set of ASCII characters, and several of those have jobs to do: / separates path segments, ? starts the query string, & separates parameters, = joins a name to its value and # starts the fragment. If a value you want to send contains one of these characters, or a space, an accented letter or an emoji, it must be percent-encoded: each byte is written as % followed by two hexadecimal digits. A space becomes %20, an ampersand becomes %26, and the letter é, which is two bytes in UTF-8, becomes %C3%A9.
Reserved and unreserved characters
RFC 3986, the URL standard, splits characters into groups. Unreserved characters never need encoding. Reserved characters must be encoded when they appear inside data rather than as delimiters. Everything else, including spaces and all non-ASCII text, must always be encoded.
| Group | Characters |
|---|---|
| Unreserved | A–Z a–z 0–9 - . _ ~ |
| Reserved delimiters | : / ? # [ ] @ |
| Reserved sub-delimiters | ! $ & ' ( ) * + , ; = |
Component, full URL or form encoding?
The three styles in this tool match what JavaScript and browsers actually do. Here is how each one encodes the text a b&c=d/é:
| Style | Result | Use it for |
|---|---|---|
| Component | a%20b%26c%3Dd%2F%C3%A9 | One query value or path segment |
| Full URL | a%20b&c=d/%C3%A9 | A complete URL whose structure must survive |
| Form | a+b%26c%3Dd%2F%C3%A9 | HTML form bodies and URLSearchParams |
Component (encodeURIComponent) is the right choice nine times out of ten: build the URL from pieces and encode each value on its own. Full URL (encodeURI) leaves delimiters alone, which is useful for cleaning up a link that contains spaces or Unicode, but it will not protect an & inside a value. Form encoding is what a browser sends when a form is submitted with the default content type: spaces become +, and a literal plus sign must be sent as %2B.
A worked example
Suppose a search box should send the phrase fish & chips to /search?q=. Pasting the raw text produces /search?q=fish & chips, which a server reads as a parameter q=fish followed by a second, empty parameter called chips. Encoding the value first gives /search?q=fish%20%26%20chips, which arrives as intended.
Common mistakes
- Double encoding. Encoding an already encoded string turns
%20into%2520. If you see%25followed by two hex digits, something was encoded twice. - Using encodeURI on values. It leaves
&,=and?untouched, so values containing them break the query string. - Forgetting that + means space in forms. When decoding query strings, choose the Form style or a literal plus sign will be read differently from what the server sees.
- Mixing character sets. Modern URLs use UTF-8. Old systems sometimes sent Latin-1 bytes such as
%E9, which are not valid UTF-8 and cannot be decoded here.
Building tracking links? The UTM Builder encodes every parameter for you.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent encodes every reserved character, including the slash, question mark, ampersand, equals sign and hash, so it is safe for individual values. encodeURI leaves those delimiters alone so that a complete URL keeps working.
Should spaces be encoded as %20 or +?
Both are common. %20 is correct anywhere in a URL. The + sign means a space only in form-encoded data and query strings, so use %20 in paths and when in doubt.
Why do I see %2520 in my URL?
The text was encoded twice. The first pass turned a space into %20, and the second encoded the % sign itself as %25. Decode it once to fix it.
Why does decoding fail with a malformed URI error?
Either a % sign is not followed by two hexadecimal digits, or the escapes form bytes that are not valid UTF-8. The error message tells you which one and where it is.
Can I encode a list of URLs at once?
Yes. Paste one item per line and tick Process each line separately. Each line is converted on its own and line breaks are kept.