URL Encoder / Decoder

Encode text so it can travel safely inside a URL, or decode a percent-encoded link back into readable text. If a URL contains a broken % sequence, the tool shows you where it is.

Your text and URLs are encoded and decoded inside your browser and are never sent to our server.

How to use the URL Encoder / Decoder

  1. Paste your text or URL into the top box.
  2. To put a value inside a URL (a search term, a file name, a redirect address), press Encode component. To clean up a whole URL that contains spaces or accented letters, press Encode full URL.
  3. To read an encoded link, press Decode. If the text came from an HTML form, tick treat + as a space first.
  4. If the input is a complete URL, check the URL breakdown table to see the host, path and each query parameter decoded separately.

encodeURIComponent vs. encodeURI

Both functions replace unsafe characters with a % followed by the two-digit hexadecimal value of each UTF-8 byte, so "é" becomes %C3%A9 and a space becomes %20. They differ in which characters they leave alone:

Neither function encodes ! ' ( ) *, even though the URI standard reserves them. If a system you are sending to is strict about those characters, encode them by hand.

Spaces, plus signs and malformed sequences

HTML forms submitted with the default application/x-www-form-urlencoded format write spaces as + rather than %20. The two checkboxes let you produce and read that style. Without the decoding option, a + is kept as a literal plus sign, which is what decodeURIComponent does.

Decoding fails with a "URI malformed" error when the input contains a % that is not followed by two hex digits, or a sequence of bytes that is not valid UTF-8, for example %E9 from an old Latin-1 web page. Instead of just reporting the error, this tool finds the first broken sequence and highlights it with its line and column.

Frequently asked questions

Which button should I use for a query parameter?

Encode component. Encode each value on its own, then join them with & and =. Encoding the whole URL with it would also encode the slashes, the "?" and the "&", and the link would stop working.

Why does decoding say my URL is malformed?

There is a percent sign that is not followed by two hexadecimal digits, such as "100%" written literally, or the encoded bytes are not valid UTF-8. The error message highlights the exact spot. A literal percent sign should be written as %25.

What is double encoding?

It happens when already-encoded text is encoded again, so %20 becomes %2520. After decoding once you still see percent sequences. Decode a second time to get the original text, and fix the code that encodes twice.

Does this encode non-English characters?

Yes. Characters outside ASCII, such as ő, ß, 中 or emoji, are converted to their UTF-8 bytes and each byte is written as %XX.

Is my URL sent to a server?

No. Encoding, decoding and the URL breakdown all use JavaScript built into your browser. Nothing is uploaded or logged by this page.

Sources: MDN Web Docs: encodeURI(); MDN Web Docs: encodeURIComponent() (course mirror)

Related tools