Skip to content
OddsockLocal
Local
Source text

Formatting

5 wordsRuns in this browser. Nothing is uploaded.

How to use

  1. Paste the percent-encoded text.
  2. Leave Direction on decode.
  3. Read the characters. %20 is a space, %2F is a slash, %26 is an ampersand.
  4. If plus signs remain, the original encoder used form encoding. The query parser treats + as a space.

What is URL decoder?

URL decoder starts on decode and uses decodeURIComponent, which is the function that undoes a query value. a%20b%2Fc%3Fd%3De%26f becomes a b/c?d=e&f. The space, the slash, the question mark, the equals sign and the ampersand were all encoded, so they all come back. A plus sign is not a space here. decodeURIComponent does not treat + as a space; the query-string parser does.

Read more

That distinction is why a value copied from a query string sometimes still shows plus signs after a visit to this page. If the encoder was URLSearchParams, spaces left as +. If the encoder was encodeURIComponent, spaces left as %20. Decode the form you actually have. A stray % that is not followed by two hex digits throws.

The encoder page is the same pair of functions with Direction starting on encode. encodeURI, the looser function that leaves / ? & = alone, is not what either page runs.

Use cases

  • A query value was copied as a%20b%2Fc%3Fd%3De%26f and you need the slashes and the ampersand visible.
  • You want to see that + is left as a plus, so you know to use the query parser when the source was a form encoding.
  • A double-encoded value such as %2520 should become %20 on one pass, not a space, so you can tell how many times it was encoded.
  • An illegal % at the end of a string should fail instead of being copied through.

A fully encoded query value

Direction decode. a%20b%2Fc%3Fd%3De%26f

a b/c?d=e&f

Why use Oddsock

Plus signs stay plus signs. If this page turned them into spaces, it would disagree with decodeURIComponent and hide which encoder was used.

Related tools

Using this tool

This page calls decodeURIComponent. Plus is a literal plus. In a query string built with URLSearchParams, + means space, and the query parser is the page that applies that rule.