URL encoder and decoder

Percent-encode or decode text and URLs with full Unicode support, and see every query parameter of a URL decoded. Everything runs in your browser; nothing is uploaded.

Encoded
The result appears here.

How to use it

Choose Encode or Decode and paste your text. Everything runs in your browser; nothing is sent anywhere.

  • Part of a URL encodes every special character, including & = ? / #. Use it for one query value or path segment, for example a search term.
  • Whole URL keeps the characters that give a URL its structure and only encodes spaces, Hindi and other non-ASCII text, and unsafe characters.
  • When decoding, Treat + as a space matches how query strings and HTML forms are written. Turn it off if a real + should stay.

Paste a full URL to also see its parts and every query parameter decoded in a table.

URL encoding in code

  • JavaScript: encodeURIComponent(value) for a part, encodeURI(url) for a whole URL, and decodeURIComponent(text)
  • Python: urllib.parse.quote(value, safe='') and urllib.parse.unquote_plus(text)
  • Java: URLEncoder.encode(value, StandardCharsets.UTF_8) (writes spaces as +)

Questions

What is URL encoding?

Also called percent-encoding: characters that are not allowed or have a special meaning in a URL are written as % followed by two hex digits of their UTF-8 bytes. A space becomes %20, & becomes %26 and the Hindi letter न becomes %E0%A4%A8.

Should a space be %20 or +?

Both mean a space inside a query string (the part after ?), because HTML forms send spaces as +. In the path part of a URL only %20 works, so %20 is the safe choice unless a system asks for +.

Why does my decoded text still have %20 in it?

The text was encoded twice (%2520 is an encoded %20). Use “Still encoded: decode again” until the text is clean, and fix the code that encodes it twice.

Why do I get an error when decoding?

Either a % is not followed by two hex digits (for example a real “100%”), or the %XX bytes do not form complete UTF-8 characters, which happens when an encoded URL was cut off.

More tools