URL Encode & Decode

Percent-encode text for a URL or decode %20-style URLs back to readable text. Paste a full link to see its query parameters in a table.

Runs in your browser; nothing you paste is sent anywhere.

Query value / path part (encodeURIComponent)
Encoded

This URL encoder and decoder converts text to percent-encoding, the %20-style format that lets spaces, symbols and any language travel safely in a web address, and turns encoded URLs back into something you can read. It offers the same three encodings developers use day to day: a single value, a whole URL, and HTML form data. Paste a complete link and you also get its host, path and every query parameter, decoded, in a table.

Common Encoded Characters

CharacterEncodedWhy it needs encoding
space%20 (or + in form data)Not allowed in URLs
&%26Separates query parameters
=%3DSeparates a parameter name from its value
?%3FStarts the query string
/%2FSeparates path segments
#%23Starts the fragment, which is never sent to the server
+%2BMeans a space in form data
%%25Starts every encoded sequence
é%C3%A9Non-ASCII: encoded as its UTF-8 bytes

Which Encoding to Choose

  • Query value / path part (encodeURIComponent): for anything you insert into a URL, such as a search term, a redirect URL passed as a parameter, or a file name. This is the right choice most of the time.
  • Whole URL (encodeURI): for a complete address that contains spaces or non-English characters but whose ?, & and / should keep their meaning.
  • Form data: the application/x-www-form-urlencoded format that HTML forms and URLSearchParams produce, with spaces as +. Use it for POST bodies and to match what a browser form would send.

How Percent-Encoding Works

RFC 3986, the URL standard, allows only a small set of characters to appear as they are: letters, digits and - . _ ~, plus the reserved characters that give a URL its structure. Everything else is converted to UTF-8 bytes and each byte written as % followed by two hexadecimal digits. Decoding reverses this. A URL that has been encoded twice shows %2520 where a space should be, because the % of %20 was itself encoded; decode it twice to get the original back.

Related Tools

Tokens passed in URLs are often Base64URL; decode those with the Base64 decoder, or a JWT with the JWT decoder. JSON from an API can be tidied in the JSON formatter.

Frequently Asked Questions

How do I decode a URL?

Choose Decode and paste the URL or text. Every %XX sequence is turned back into its character, read as UTF-8, so %20 becomes a space and %C3%A9 becomes é. If you paste a whole link, its query parameters are also listed in a table, already decoded.

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), so it is right for a single value you are putting into a URL, such as a search term. encodeURI leaves the characters that give a URL its structure (: / ? # & = and others) alone, so it is for a complete URL that only needs spaces and non-English characters fixed. Using encodeURI on a value lets an & or = inside it break the query string.

Should a space be %20 or +?

In a path, a space must be %20. In a query string sent by an HTML form (application/x-www-form-urlencoded), a space is written as +, and a literal + as %2B. Most servers read both in query strings. Choose Form data when encoding to get + for spaces, and keep Treat + as a space on when decoding query strings.

Why does decoding fail with a % sign?

A % in an encoded URL must start a sequence of two hex digits. A literal percent sign, as in 100%, has to be written %25. The error shows the position of the stray % so you can fix it, or the text may simply not be URL-encoded.

Why do some characters turn into several %XX codes?

URLs are encoded as UTF-8 bytes. Characters outside basic English take 2 to 4 bytes, and each byte becomes one %XX: é is %C3%A9 and the emoji 😀 is %F0%9F%98%80.

Is my URL sent anywhere?

No. Encoding and decoding use your browser's built-in functions, so links containing tokens or personal data stay on your device.