URL Encoder & Decoder
Encode or decode percent-escapes with precise error messages, rebuild a query string from an editable table, and see exactly which part of a URL is which.
Component mode escapes / ? : @ & = + $ # too, so the result is safe to drop into a query value. URI mode leaves those alone so a full address stays usable.
How to use the URL encoder
- Choose ➡️ Encode or ⬅️ Decode. Results update as you type, and the 🔁 button sends a result back into the input so you can chain conversions.
- When encoding, pick the encoder: encodeURIComponent for a single value, encodeURI for a whole address.
- Turn on “+” as a space if you are working with form-encoded data, and Batch mode to convert a whole list, one URL per line.
- Use the 🧩 Query builder tab to paste a URL and edit its parameters as a table — change values, add rows, delete rows, and the URL is rebuilt underneath.
- Use the 🔍 URL parts tab to split any address into protocol, host, port, path, query and fragment, with warnings about anything suspicious.
How percent encoding works
A URL may only contain a small set of ASCII characters. Everything else is written as a percent sign followed by two hexadecimal digits, one escape per byte. Because the modern rule is to encode UTF-8, a character outside ASCII becomes several escapes.
| Character | UTF-8 bytes | Encoded |
|---|---|---|
| space | 20 |
%20 |
& |
26 |
%26 |
é |
C3 A9 |
%C3%A9 |
한 |
ED 95 9C |
%ED%95%9C |
| 🎉 | F0 9F 8E 89 |
%F0%9F%8E%89 |
RFC 3986 calls A–Z a–z 0–9 - . _ ~ the unreserved set: these never need escaping. The reserved set — : / ? # [ ] @ ! $ & ' ( ) * + , ; = — has structural meaning, so whether it must be escaped depends on where it appears. That is the whole difference between the two encoder modes.
Worked examples
A search query. The text hello world & more inside a query value becomes hello%20world%20%26%20more, or hello+world+%26+more with form encoding. Without escaping the ampersand, the server would read more as a second parameter.
A URL used as a parameter. To put https://example.com/a?b=1 inside ?next=, component mode gives https%3A%2F%2Fexample.com%2Fa%3Fb%3D1. Use URI mode here by mistake and the colons, slashes and question mark survive — the server then sees your redirect target as part of its own query string.
Spotting double encoding. search?q=hello%2520world looks odd because %25 is a percent sign. Decoding once gives hello%20world; decoding twice gives hello world. If your logs are full of %2520, some layer in the chain is encoding an already-encoded value.
Breaking down a URL. https://user@example.com:8443/docs/a%20b?tab=1#top splits into protocol https, user user, host example.com, port 8443, path /docs/a%20b, query tab=1 and fragment top. The tool flags the embedded username, because credentials in a URL end up in server logs and browser history.
Tips and common mistakes
- The fragment never reaches the server. Everything after
#stays in the browser. Do not put anything there that a backend needs. - Encode values, not whole query strings. Encode each key and each value separately, then join them with
=and&. Encoding the assembled string escapes the separators too. - A plus in a path is a plus.
/a+bis a literal plus; only in a query or form body does it mean a space. - Do not encode twice. If a library already escapes for you, escaping again produces
%2520. Encode at exactly one layer. - Case in escapes does not matter, but uppercase is the norm.
%edand%EDare the same byte; RFC 3986 recommends uppercase. - Watch the tilde.
encodeURIComponentleaves~alone, but some older server libraries escape it as%7E. Both are correct and they are not string-equal — normalise before comparing signatures.
Glossary
- Percent encoding – representing a byte as
%plus two hex digits; also called URL encoding. - Unreserved characters – the set that never needs escaping: letters, digits,
-,.,_and~. - Form encoding –
application/x-www-form-urlencoded, the variant where a space is written as+. - Punycode – the ASCII representation of an internationalised domain name, for example
xn--h28h. - Fragment – the part after
#, used by the browser and never sent to the server.
Privacy
Encoding, decoding, query parsing and URL splitting all happen inside your browser tab in plain JavaScript. Nothing you type is sent anywhere, written to storage or logged — there is no server-side component that could receive it. This matters more for URLs than for most data: query strings routinely carry session identifiers, password-reset tokens, signed download links and personal details, and pasting one into a tool that round-trips through a server would hand all of that over. Here, closing the tab is the end of it.
Frequently asked questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes everything that is not unreserved, including the structural characters / ? : @ & = + and #. encodeURI leaves those alone so a complete address stays usable. Use the first for one value going into a query string, the second for tidying up a whole URL.
Why does a space sometimes become %20 and sometimes a plus sign?
Percent encoding always produces %20. The plus sign comes from HTML form encoding, application/x-www-form-urlencoded, which is used for query strings and form bodies. Both decode to a space there, but a plus in a path segment is a literal plus, not a space.
What does double encoding look like and why does it happen?
It looks like %2520 where you expected %20 — a percent sign that was itself encoded. It normally happens when a value passes through two layers that each encode it, such as a client library plus a proxy. The tool detects this and offers to decode twice.
Can I put non-English characters straight into a URL?
Browsers display them, but on the wire they must be encoded. The host is converted to punycode and everything else becomes percent-encoded UTF-8 bytes, so the Korean character 한 travels as %ED%95%9C. Pasting raw characters into an API call often fails for exactly this reason.
Why does the decoder complain about "not valid UTF-8"?
Because the bytes behind the escapes do not form a legal UTF-8 character. That usually means the text was encoded as Latin-1 or Shift-JIS, or that a long escape sequence was truncated. The tool tells you which bytes are the problem instead of silently producing replacement characters.
Is it safe to paste a URL with a token in it here?
Yes, because nothing leaves your browser. The encoding, decoding and parsing all run in the page's JavaScript, with no network request and no storage. That is deliberate, since URLs carrying session ids and signed tokens are exactly what people paste into tools like this.
Related tools
- Base64 Encoder & DecoderConvert text, files and data URIs to and from Base64 with correct UTF-8 handling, a URL-safe option and MIME line wrapping. Nothing is uploaded.
- JSON Formatter & ValidatorPaste JSON, get it beautified, minified or validated with the exact line and column of the problem. Everything runs in your browser.
- JWT DecoderPaste a JWT to read its header and payload, understand every claim in plain English and see at a glance whether it is still valid. The signature is not verified, and the token never leaves your browser.
- Cron Expression GeneratorWrite a cron expression in Unix, Spring or Quartz form, read what it actually means in English, and see the next ten fire times in UTC and your local time.
- Unix Timestamp ConverterA live epoch clock, instant timestamp-to-date conversion in UTC and your local time, a date-to-timestamp direction, and a batch mode for whole log columns.
- Password GeneratorBuild a random password or a memorable passphrase with real cryptographic randomness. Entropy, strength and crack time are shown for the exact options you picked — and nothing ever leaves your browser.
Last reviewed: