URL Encoder/Decoder

Easily encode URLs to ASCII percent-encoding or decode them back to readable format. Our free tool ensures your links are web-safe and compatible with all browsers

Data to encode:

Example: 京

Data to decode:

Example: %E4%BA%AC

A URL encoder converts text into a form that can safely go inside a URL, and a URL decoder turns it back. Characters that have special meaning in URLs, or that aren't allowed at all, are replaced by a % followed by their byte value in hexadecimal. This is called percent-encoding. The tool runs in your browser.

How to encode or decode a URL

  1. To encode, paste text into Data to encode and click Encode. Use this for a value you are putting into a query string or path, such as a search term, an email address or a redirect URL.
  2. To decode, paste percent-encoded text into Data to decode and click Decode.

What gets encoded

The encoder works like JavaScript's encodeURIComponent: letters, digits and - _ . ! ~ * ' ( ) stay as they are; everything else is encoded as UTF-8 bytes.

CharacterEncodedWhy it needs encoding
space%20Not allowed in URLs
&%26Separates query parameters
=%3DSeparates a parameter name from its value
?%3FStarts the query string
/%2FSeparates path segments
#%23Starts the fragment
é%C3%A9Non-ASCII: encoded as its two UTF-8 bytes

Common problems

  • Encoding a whole URL breaks it. This tool encodes :, / and ? too, which is right for a value inside a URL, such as ?redirect=https%3A%2F%2Fexample.com%2F, but wrong for the URL itself. Encode only the parts that are values.
  • Plus signs instead of spaces. HTML forms encode spaces as + in query strings. This decoder follows URL rules and leaves + unchanged; replace it with a space first if the text came from form data.
  • Double encoding. If you see %2520, the text was encoded twice (% became %25). Decode it twice.
  • "Invalid URL encoded string". A % is followed by something that isn't two hex digits, or the bytes don't form valid UTF-8.

Frequently asked questions

Should a space be %20 or +?

%20 is correct anywhere in a URL. + means a space only in query strings encoded as HTML form data (application/x-www-form-urlencoded). When in doubt, use %20.

What is the difference between URL encoding and HTML encoding?

URL encoding makes text safe inside a URL using %XX codes. HTML encoding makes text safe to display inside an HTML page using entities like <. A URL placed in an HTML attribute may need both.

How do I URL-encode non-English characters?

Paste them into the encoder: they are converted to UTF-8 and each byte is percent-encoded, so ü becomes %C3%BC. For domain names, use Punycode instead.