URL Decode
Decode percent-encoded URL strings back to plain text.
Percent-encode any text or URL using encodeURIComponent. Spaces become %20, slashes become %2F, and all special characters are converted to safe URL tokens. Everything runs in your browser.
A URL is not free text. RFC 3986 allows only a small set of US-ASCII characters, and some of those are reserved as structural delimiters: the slash separates path segments, the question mark starts the query, the ampersand separates parameters, the equals sign splits a key from its value, and the hash begins the fragment. If your data contains any of those characters, the parser on the other end will read them as structure rather than content.
Percent-encoding is the escape mechanism. The character is converted to its bytes in UTF-8, and each byte is written as a percent sign followed by two hexadecimal digits. A space becomes %20. Characters outside ASCII take multiple bytes, so the euro sign becomes %E2%82%AC, three bytes and therefore three escape sequences.
The unreserved set is guaranteed safe anywhere in a URL and must be left alone, because encoding it changes nothing semantically but breaks string comparison and cache keys.
This is the single most common source of broken links. The two functions differ in one respect: whether they treat reserved delimiters as structure to preserve or as data to escape.
The rule of thumb: if you are building a URL, use encodeURI once at the end or, better, build it with a URL object. If you are inserting a value into a URL, always use encodeURIComponent on that value alone.
Redirect parameters are where this bites hardest. Suppose you want to pass an entire search URL as the value of a redirect parameter.
HTML form submissions use the media type application/x-www-form-urlencoded, which predates RFC 3986 and has one important quirk: a space is written as a plus sign rather than %20. Everything else follows percent-encoding as normal, and a literal plus sign in the data is encoded as %2B so the two cannot be confused.
Servers usually apply form decoding to query strings as well, which is why %20 and plus both tend to work in practice. Do not rely on it: a plus sign that survives into a value processed by a strict RFC 3986 parser stays a plus sign, and a password or search term silently changes meaning.
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.
| Character | Encoded | Name |
|---|---|---|
| space | %20 | Space |
| ! | %21 | Exclamation mark |
| " | %22 | Double quote |
| # | %23 | Hash / fragment delimiter |
| $ | %24 | Dollar sign |
| % | %25 | Percent sign |
| & | %26 | Ampersand / parameter separator |
| ' | %27 | Apostrophe |
| ( | %28 | Left parenthesis |
| ) | %29 | Right parenthesis |
| * | %2A | Asterisk |
| + | %2B | Plus sign |
| , | %2C | Comma |
| / | %2F | Slash / path separator |
| : | %3A | Colon / scheme separator |
| ; | %3B | Semicolon |
| = | %3D | Equals / key value separator |
| ? | %3F | Question mark / query start |
| @ | %40 | At sign |
| [ | %5B | Left square bracket |
| ] | %5D | Right square bracket |
| newline | %0A | Line feed |
| tab | %09 | Horizontal tab |
Working on something related? Browse every free developer tool on the site, including a URL decoder, Base64 encoder, HTML encoder, and query string helpers. Everything runs entirely in your browser, so nothing you paste is ever uploaded.
URL encoding is a fundamental part of working with HTTP. Query parameters, form submissions, and API calls all rely on percent-encoding to safely carry arbitrary text inside a URL. This tool uses the browser's native encodeURIComponent function, which handles Unicode correctly by first converting characters to their UTF-8 byte sequences and then percent-encoding each byte. It is the standard choice for encoding individual query parameter values before appending them to a URL.