JSONToonPro
Encoding tool

URL Decode

Convert percent-encoded URL strings back to readable text using decodeURIComponent. Paste any encoded URL or query string and see the plain-text result instantly. All processing happens in your browser.

100% client sideInstant resultNo data sent
Encoded string
0 chars
Decoded text
Result appears here...

How URL Decoding Works

Decoding is a simple scan. The decoder walks the string one character at a time and copies everything straight through until it meets a percent sign. At that point it reads the next two characters, interprets them as a hexadecimal byte value, and writes that byte to the output. When the scan is finished, the collected bytes are interpreted as UTF-8 text.

That last step matters for non-ASCII content. Characters outside ASCII were encoded as several bytes, so %E2%82%AC is not three separate characters but one euro sign assembled from three consecutive escape sequences. A decoder that handles each escape in isolation produces mojibake.

Worked Example

Input:
name%3DJohn%20Doe%26city%3DS%C3%A3o%20Paulo
 
Scan:
%3D -> 0x3D -> =
%20 -> 0x20 -> space
%26 -> 0x26 -> &
%C3%A3 -> bytes C3 A3 -> one UTF-8 character: a with tilde
 
Output:
name=John Doe&city=Sao Paulo (with the tilde restored)

Why Decoding Fails

  • Malformed sequences. %ZZ or %G1 are not hexadecimal, so the decoder throws. In JavaScript this surfaces as a URIError from decodeURIComponent.
  • Truncated escape. A percent sign at the very end of the string, or followed by only one character, has nothing to read.
  • Literal percent signs.Text like "50% off" that was never encoded will break a decoder, because %20 is read as an escape sequence. A literal percent must always be written as %25.
  • Invalid UTF-8. Byte sequences that do not form valid UTF-8, often because the value was encoded in Latin-1, decode to replacement characters.

The Plus Sign Problem

Form submissions encode a space as a plus sign, but decodeURIComponent implements RFC 3986 and knows nothing about that convention. Feed it form data and every space comes back as a literal plus.

decodeURIComponent("hello+world") -> "hello+world" wrong
decodeURIComponent("hello%20world") -> "hello world" right
 
For form-encoded input, replace + with a space first:
decodeURIComponent(input.replace(/\+/g, " "))
 
Or let the platform do it:
new URLSearchParams("q=hello+world").get("q") -> "hello world"

Beware of doing the replacement blindly. If the value legitimately contains a plus sign, for example a phone number or an email address with a plus tag, and it was correctly encoded as %2B, that escape survives the naive replace and decodes back to a plus. But a raw plus that was never meant as a space will be destroyed.

Double Encoding and How to Spot It

Double encoding happens when a value passes through two encoding steps, typically because one layer of a system encodes defensively and another does it again. The signature is a percent sign followed by 25, since the percent sign of the first escape gets encoded on the second pass.

Original: hello world
Encoded once: hello%20world
Encoded twice: hello%2520world %25 is the encoded %
 
Decoding once: hello%20world still looks encoded
Decoding twice: hello world
 
Red flags in a URL: %2520 %253A %2526 %25252F

The correct fix is to remove the duplicate encoding step, not to decode twice in the consumer. Blind repeated decoding is a known security hazard: filters that inspect a URL once but a downstream component decodes twice have been the root cause of path traversal and access control bypasses.

Percent-Encoding Reference Table

These are the characters you meet most often when working with query strings, path segments, and form data. Each one is replaced by a percent sign followed by the two hexadecimal digits of its byte value.

CharacterEncodedName
space%20Space
!%21Exclamation mark
"%22Double quote
#%23Hash / fragment delimiter
$%24Dollar sign
%%25Percent sign
&%26Ampersand / parameter separator
'%27Apostrophe
(%28Left parenthesis
)%29Right parenthesis
*%2AAsterisk
+%2BPlus sign
,%2CComma
/%2FSlash / path separator
:%3AColon / scheme separator
;%3BSemicolon
=%3DEquals / key value separator
?%3FQuestion mark / query start
@%40At sign
[%5BLeft square bracket
]%5DRight square bracket
newline%0ALine feed
tab%09Horizontal tab

Working on something related? Browse every free developer tool on the site, including a URL encoder, Base64 decoder, HTML decoder, and JSON formatter. Everything runs entirely in your browser, so nothing you paste is ever uploaded.

Frequently asked questions

4 answers
URL decoding reverses the percent-encoding process. It converts sequences like %20 back to a space, %2F back to a forward slash, and %C3%A9 back to the Unicode character e with an accent. This tool uses the browser's native decodeURIComponent function, which correctly reconstructs Unicode characters from their multi-byte UTF-8 percent-encoded sequences.

More JSON Tools

About URL Decoding

Percent-encoded URLs are common when working with web APIs, browser address bars, and server logs. A URL like q=hello%20world%26lang%3Den is much harder to read than q=hello world&lang=en. This decoder converts those sequences back to human-readable form so you can debug requests, inspect redirects, or read log entries without doing the conversion in your head. It uses the browser's native decodeURIComponent which correctly handles multi-byte Unicode sequences encoded in UTF-8.