URL Encode & Decode Online

A URL only accepts a subset of characters directly; spaces, question marks, ampersands and non-Latin letters have to be percent-encoded, for example as %20. This tool uses encodeURIComponent, which is the right choice for query values and path segments, and decodeURIComponent for the way back so Persian text becomes readable again. Invalid percent sequences produce an error instead of mangled output.

This tool runs entirely in your browser. No data is sent to any server.

How to use it

  1. 1

    Enter the link or text you want to put inside a URL.

  2. 2

    Press Encode to get the percent-encoded form, or Decode for the reverse.

  3. 3

    Copy the result into an API address, a query parameter or a share link.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps the structure of a whole address, while encodeURIComponent escapes every reserved character and is correct for a single parameter value. This tool uses the latter.

Why does a space become %20?

A literal space is not allowed in a URL, so it is written percent-encoded; %20 is the hexadecimal code for a space.

Does it handle non-Latin text?

Yes. Encoding is UTF-8 based, so Persian letters are converted and restored byte for byte in the right order.