tigtools

URL Encoder / Decoder

Encode text for use in a URL, or turn %20-style escapes back into readable text. Choose Component for a single value or Full URL for a complete address.

Runs in your browser No sign-up

Direction
What are you encoding?

Component (encodeURIComponent) escapes everything except letters, digits and - _ . ! ~ * ' ( ). Use it for one query value, form field or path segment.

How to use it

  1. Choose Encode or Decode.
  2. Choose Component for a single value (such as one query parameter) or Full URL for a whole address.
  3. Type or paste your text. The result appears instantly on the right (or below on phones).
  4. Copy the result, or use “Use output as input” to reverse the operation and check the round trip.

How it works

URLs may only contain a limited set of ASCII characters. Everything else, including spaces, accented letters and emoji, is written as percent escapes: the character is converted to UTF-8 bytes and each byte becomes % followed by two hexadecimal digits. A space becomes %20, é becomes %C3%A9 and € becomes %E2%82%AC.

Component mode uses JavaScript's encodeURIComponent and decodeURIComponent. It escapes every character that has a special meaning in a URL, including / ? # & = + : and @, so the result can safely be placed inside a query value or a single path segment. It leaves only A–Z, a–z, 0–9 and - _ . ! ~ * ' ( ) unchanged.

Full URL mode uses encodeURI and decodeURI. It assumes the input is already a complete URL and leaves the reserved characters ; , / ? : @ & = + $ # untouched, so the address keeps working. When decoding, decodeURI also leaves escapes of those reserved characters alone: %2F stays %2F, because turning it into / would change the meaning of the URL.

The form-data option follows application/x-www-form-urlencoded, the format browsers use when submitting HTML forms: a space is written as + instead of %20. When decoding with this option, every + becomes a space; a real plus sign must then be written as %2B.

Invalid input is never discarded. If a % is not followed by two hexadecimal digits, or a sequence of escapes does not form valid UTF-8, the tool shows where the problem is and keeps your text so you can fix it.

Examples

Putting a value into a query string

To search for “Rock & Roll” at https://example.com/search?q=…, encode only the value in Component mode: Rock%20%26%20Roll. Without encoding, the & would end the q parameter and start a new one called “ Roll”.

Fixing a URL with spaces and accents

In Full URL mode, https://example.com/menu/crème brûlée.html becomes https://example.com/menu/cr%C3%A8me%20br%C3%BBl%C3%A9e.html. The slashes and colon stay as they are, so the link still works.

Reading logged form data

A server log shows name=Jane+Doe&city=S%C3%A3o+Paulo. Decode it in Component mode with “Treat + as a space” switched on to read name=Jane Doe&city=São Paulo.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes the characters that separate URL parts (/ ? # & = + : @ and others), so it is meant for one piece of a URL. encodeURI keeps those characters, so it is meant for a complete URL. Using encodeURI on a query value is a common bug: an & or = inside the value would not be escaped and would break the query string.

Should a space be %20 or +?

In the path of a URL a space is always %20. In a query string, both appear: %20 is valid everywhere, while + means a space only in form-encoded data (application/x-www-form-urlencoded), which is how HTML forms and many server frameworks read query strings. If you are unsure, use %20.

Why do I get an error when decoding?

Decoding fails when a % sign is not followed by two hexadecimal digits (for example “50% off”), or when the escaped bytes are not valid UTF-8, which usually means the text was encoded with an older character set such as Latin-1 (é as %E9 instead of %C3%A9). The error message shows the position of the problem.

Why did %2F not turn into a slash in Full URL mode?

decodeURI deliberately keeps escapes of reserved characters such as / ? # & and =, because decoding them could change how the URL is split into parts. Use Component mode to decode every escape.

Which characters are never encoded?

Both modes leave A–Z, a–z, 0–9 and - _ . ! ~ * ' ( ) unchanged. Full URL mode additionally leaves ; , / ? : @ & = + $ and # unchanged.

Privacy

Encoding and decoding run entirely in your browser with the built-in JavaScript functions. Your text and URLs are not uploaded, stored or included in analytics.