Advertisement
Guide
About the URL Encoder / Decoder
URLs can only contain a limited set of characters. Anything else — spaces, accented letters, ampersands, question marks used as data — must be percent-encoded, where each byte is written as % followed by two hex digits (a space becomes %20). This tool encodes text so it's safe inside a URL, and decodes percent-encoded URLs back to readable text.
It offers both encodeURIComponent (for individual values like query parameters) and encodeURI (for whole URLs), and breaks a query string into its parameters so you can see exactly what a link carries.
encodeURIComponent vs. encodeURI
Use encodeURIComponent when encoding a single piece of data — a query value, a path segment — because it escapes URL-structural characters like &, =, ?, and /. Use encodeURIfor an entire URL you don't want to break, since it leaves those structural characters intact. Picking the wrong one either corrupts the URL or leaves data improperly escaped.
Why encoding prevents bugs
If a query value contains an & or =and isn't encoded, the server will misread where one parameter ends and the next begins. Encoding user input before putting it in a URL avoids these parsing errors and a class of injection issues — it's a small step that prevents a lot of hard-to-trace problems.
How to use it
- 1Choose Encode or Decode.
- 2Paste your text or URL into the input.
- 3Pick encodeURIComponent for a value, or encodeURI for a full URL.
- 4Copy the result, and review the query-parameter breakdown when present.
Frequently asked questions
What is percent-encoding?
It is the mechanism URLs use to represent characters that are not allowed directly, by writing each byte as a % followed by two hexadecimal digits — for example a space as %20.
Should I use encodeURIComponent or encodeURI?
Use encodeURIComponent for individual values like query parameters, since it escapes &, =, ?, and /. Use encodeURI for a complete URL where those characters should stay intact.
Why does a space sometimes become + instead of %20?
In the query-string component of some form encodings, spaces are written as +. In path segments and with encodeURIComponent, they become %20. Both decode back to a space.
Does it handle non-English characters?
Yes. Text is encoded as UTF-8 first, so accented letters, emoji, and non-Latin scripts are percent-encoded correctly and round-trip when decoded.
Is my input uploaded?
No. Encoding and decoding run entirely in your browser.
