About the URL Encoder & Decoder
URLs may only contain a limited set of ASCII characters. Spaces, accented letters, emoji and characters with a special meaning in URLs – such as &, = , ? and # – have to be written as percent-encoded bytes, for example a space becomes %20 and "é" becomes %C3%A9. This tool converts text to that format and back.
It uses the UTF-8 encoding defined by the URL standard, the same rules as the encodeURIComponent and encodeURI functions in JavaScript. A built-in URL inspector also splits a full address into protocol, host, path, fragment and a decoded list of query parameters.
How to use it
- Choose Encode or Decode.
- Pick the mode: "Component" for a single query value or path segment, "Full URL" to keep the structure of a complete address, or "Form" for application/x-www-form-urlencoded data where spaces are written as +.
- Type or paste your text into the input box. The result updates as you type.
- Use Copy to put the result on your clipboard, or Swap to move the result into the input and reverse the direction.
- Paste a complete URL to see its parts and decoded query parameters in the URL inspector below the result.
Features
- Three encoding modes: Component (encodeURIComponent), full URL (encodeURI) and HTML form encoding with + for spaces.
- Full Unicode support: Non-Latin scripts and emoji are encoded as UTF-8 bytes, exactly as browsers do.
- Clear error messages: When decoding fails, the tool tells you where the malformed % sequence is or whether the bytes are not valid UTF-8.
- URL inspector: Shows host, port, path, fragment and every query parameter in decoded form, including repeated keys.
- Private: Everything happens in your browser, so URLs containing tokens or personal data are not sent anywhere.
Examples
Encoding a search query
To pass "coffee & cake" as a value in ?q=…, encode it in Component mode: the result is coffee%20%26%20cake. Without encoding, the & would start a new parameter.
Reading a tracking link
Paste a long link such as https://example.com/?redirect=https%3A%2F%2Fshop.example%2Fcart%3Fid%3D7 to see that the redirect parameter decodes to https://shop.example/cart?id=7.
Decoding form data
Data posted by an HTML form looks like name=Jane+Doe&city=S%C3%A3o+Paulo. Decode it in Form mode to get "name=Jane Doe&city=São Paulo".
Limitations and notes
- Full URL mode does not encode reserved characters such as / ? # & =, so it is not suitable for encoding a single parameter value – use Component mode for that.
- Decoding "%2F" in Full URL mode keeps it as %2F, because decodeURI intentionally leaves reserved characters escaped.
- Percent-encoded data in legacy encodings (for example ISO-8859-1 or Shift_JIS) cannot be decoded, because the tool expects UTF-8 bytes.
- The URL inspector only works with absolute URLs that start with a scheme such as https:.
- Internationalized domain names are shown in the punycode form returned by the browser (for example xn--…).
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURIComponent escapes every character that has a special meaning in a URL, so it is safe for one value. encodeURI leaves characters like : / ? # & = untouched so that a complete URL keeps working. The Component and Full URL modes correspond to these two functions.
Should a space be %20 or +?
Both appear in practice. %20 is correct everywhere in a URL. The + sign only means a space in the query string of HTML form submissions (application/x-www-form-urlencoded). Use Form mode when you work with that format.
Why do I get "not valid UTF-8"?
The % sequences are syntactically correct but the bytes they describe do not form valid UTF-8 text – for example %C3 without a following continuation byte. The data may have been encoded with a different character set or been cut off.
Is my URL sent to a server?
No. Encoding, decoding and parsing are done by JavaScript in this page. You can even disconnect from the internet after the page has loaded and the tool keeps working.