Genesis Forge
Genesis Forge › Free tools › Developer tools

URL encode and decode

Percent-encode text for use in a URL, or decode an encoded URL back to readable text.

Runs in your browser. Nothing you enter is uploaded.

What it does

URLs can only contain a limited set of characters. Anything else, including spaces, &, ? and non-English letters, has to be written as a percent sign and two hex digits. This tool does that conversion in both directions.

How to use it

  1. Paste the text.
  2. To encode one value, such as a search term, leave the box unticked. To clean up a complete URL, tick it.
  3. Press Encode or Decode and copy the result.

Worked example

saree & blouse/₹500 encodes to saree%20%26%20blouse%2F%E2%82%B9500.

How it works

Each character that is not allowed is converted to its UTF-8 bytes, and each byte is written as % followed by two hexadecimal digits. Encoding a single value uses encodeURIComponent, which also escapes / ? & and =. Encoding a whole URL uses encodeURI, which leaves those structural characters alone.

Questions

Should a space be %20 or +?

In a URL path it is %20. HTML form submissions write a space as + in the query string. This tool writes %20 when encoding and leaves + unchanged when decoding, so replace + with a space yourself if the value came from a form.

Why does decoding fail?

A % sign is not followed by two hex digits, or the bytes are not valid UTF-8.

Why was my text encoded twice?

Encoding an already encoded value turns % into %25. Decode once first.

Is my text sent to a server?

No. Everything runs in your browser. Nothing you type is uploaded or stored by us.

Related tools

All free tools →