Toolsel

URL Encoder / Decoder

Runs in your browser

Percent-encode or decode text and full URLs for safe use in links and queries.

Plain text

Encoded

What is a URL Encoder / Decoder?

URLs can only contain a limited set of characters safely — letters, digits, and a handful of punctuation marks. Percent-encoding is how everything else, spaces, ampersands, non-ASCII text, gets represented: each byte outside the safe set becomes a % followed by two hexadecimal digits, so a space becomes %20 and é becomes %C3%A9.

There are two encoding modes because URLs have structure. Encoding a whole URI (encodeURI) leaves structural characters like :, /, ? and & alone, since those separate the parts of the URL. Encoding a single component (encodeURIComponent) escapes those same characters, because if the value you are inserting into a query string happens to contain an &, you need it escaped or it will be read as the start of the next parameter.

How to use it

  1. Choose Encode or Decode.
  2. For encoding, pick Component when you are building a query string value or path segment, or Full URI when you are encoding an entire URL and want to keep its structural characters intact.
  3. Type or paste your text. The result updates as you type.
  4. Copy the result, or use Swap to move the output back into the input and verify the round trip.

Examples

Component encoding

Input
search?q=hello world & more
Output
search%3Fq%3Dhello%20world%20%26%20more

Full URI encoding

Input
https://example.com/search?q=hello world
Output
https://example.com/search?q=hello%20world

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI is for encoding a complete, already-structured URL — it leaves reserved characters like :, /, ?, and & untouched because removing them would break the URL. encodeURIComponent is for encoding a single value that will be inserted into a URL — a query parameter, a path segment — and escapes those same reserved characters, because inside a component they are just data, not structure.
Why do spaces sometimes become %20 and sometimes +?
%20 is the correct percent-encoding of a space and works everywhere. + is a legacy convention specific to the application/x-www-form-urlencoded format used by HTML form submissions, where it means space inside the query string only. This tool uses %20, which is unambiguous in every context.
Why does decoding sometimes fail?
A decode fails when a % is not followed by two valid hexadecimal digits, or when the decoded bytes do not form valid UTF-8 — for example if the input was truncated mid-sequence. The error message names the malformed sequence.
Should I encode an entire URL before sharing it?
Usually not the whole thing — only encode the parts that come from user input or contain special characters, using Component mode, and insert them into the URL structure yourself. Running Full URI encoding on a URL that already has a query string can double-encode the & and = characters and break it.