🔗 URL Encoder & Decoder

A URL encoder decoder with a full percent-encoding reference and the encodeURI vs encodeURIComponent difference that quietly breaks query strings.

Free No Signup Required Browser-Based

What URL Encoder & Decoder Does

Percent-encoding replaces characters that would otherwise have structural meaning in a URL, or that cannot be transmitted safely, with a percent sign followed by two hexadecimal digits. RFC 3986 defines which characters are safe and which are reserved.

The distinction that causes most bugs is between encoding a whole URL and encoding one value inside it. A query parameter containing "a&b=c" must have its ampersand and equals sign encoded, or the server will read them as separators and the value will be silently truncated.

Encoding and decoding here run in your browser. The reference table below gives the codes people actually look up, and the sections after it cover the two mistakes that produce most real-world breakage: using the wrong encode function, and encoding something twice.

How to Use URL Encoder & Decoder

  1. Choose "Encode" or "Decode" mode
  2. Paste your URL or encoded string
  3. Click the action button to process
  4. Copy the encoded or decoded result

Percent-Encoding Reference

The codes most often looked up. Verified against the JavaScript engine — note that encodeURIComponent deliberately leaves ! ' ( ) * unencoded even though some encoders escape them.

CharacterCodeCharacterCode
space%20;%3B
!%21=%3D
"%22?%3F
#%23@%40
$%24[%5B
%%25\%5C
&%26]%5D
'%27^%5E
+%2B`%60
,%2C{%7B
/%2F|%7C
:%3A}%7D
<%3C>%3E

Which Function to Use

Encoding the same URL three ways. The difference is which characters are treated as structure and which as data.

FunctionLeaves aloneUse for
encodeURI: / ? # [ ] @ & = + $ ,A complete URL you want to keep working
encodeURIComponentA–Z a–z 0–9 - _ . ~ ! ' ( ) *One parameter value going into a URL
encodeURI on "https://example.com/a b?x=1"Result: https://example.com/a%20b?x=1Only the space is escaped; the URL still functions
encodeURIComponent on the same stringResult: https%3A%2F%2Fexample.com%2Fa%20b%3Fx%3D1Everything escaped — correct only if this whole string is a value

Reserved vs Unreserved (RFC 3986)

ClassCharactersBehavior
UnreservedA–Z a–z 0–9 - _ . ~Never need encoding; encoding them changes nothing semantically
Reserved (general delimiters): / ? # [ ] @Structural. Encode when they are data, not structure
Reserved (sub-delimiters)! $ & ' ( ) * + , ; =Meaning depends on the URL component
Everything elsespace, ", <, >, %, {, }, |, \, ^, `, non-ASCIIMust be encoded

Source: RFC 3986 — Uniform Resource Identifier (URI): Generic Syntax

How to Read Your Result

Space is %20 in a path and + in a form

Both are correct, in different places. Percent-encoding gives %20. HTML form submission uses application/x-www-form-urlencoded, which encodes a space as +. The trap is that they do not round-trip through the same function: decodeURIComponent("a+b") returns "a+b", not "a b" — the plus is left as a literal. If you are parsing a query string by hand, replace + with a space before decoding, or use URLSearchParams which handles it.

Double encoding produces %2520

Encode "a b" once and you get "a%20b". Encode that result again and the percent sign itself is escaped, giving "a%2520b". Seeing %25 followed by two more hex digits in a log or a URL is the signature of a value that was encoded twice — usually because one layer of a stack encodes and another layer encodes again. Decode once and check before adding another encode call.

Encode values, not whole URLs

The most common real bug is building a URL by encoding the entire thing. That escapes the :// and the ? and the &, so the browser treats the whole string as a single relative path. Build the URL from parts, encoding only each parameter value — or use the URL and URLSearchParams APIs, which get this right by construction.

Non-ASCII becomes multiple bytes

Percent-encoding operates on bytes, not characters, and modern URLs use UTF-8. A character outside ASCII becomes two, three or four percent triplets — "é" is %C3%A9, and an emoji is four triplets. That is correct behavior, not corruption, and it is why an encoded non-English string looks far longer than the original.

Limitations & Accuracy Notes

  • This tool uses the browser's encodeURIComponent and decodeURIComponent. Those follow RFC 3986 with the documented exception that ! ' ( ) * are left unencoded — some server-side encoders escape them, so output may differ slightly from another tool.
  • Decoding a malformed sequence — a stray percent sign, or %ZZ — throws rather than guessing. That is deliberate; silently repairing broken input hides bugs.
  • Form encoding (+ for space) is not the same as URI encoding (%20). This tool does URI encoding; convert plus signs yourself if you are handling form data.
  • Internationalized domain names use Punycode in the host portion, not percent-encoding. Only the path and query are percent-encoded.
  • Encoding is not encryption or obfuscation. Anything you encode is trivially readable by anyone who receives it.

Frequently Asked Questions

What is URL encoding?
URL encoding (percent-encoding) replaces special characters with a % sign followed by two hexadecimal digits. This ensures URLs are transmitted correctly over the internet.
When should I URL encode?
URL encode whenever you include special characters in URLs, query parameters, or form data. Characters like spaces, &, =, and # need encoding to be interpreted correctly.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is for a whole URL and deliberately leaves the structural characters — colon, slash, question mark, ampersand, hash — intact. encodeURIComponent is for a single value going into a query parameter and escapes those too. Using the wrong one is the classic cause of a parameter that breaks when its value contains an ampersand.
Why is a space sometimes %20 and sometimes a plus sign?
Both appear in the wild. Percent-20 is the correct encoding anywhere in a URL. The plus sign is a convention specific to HTML form submissions in the application/x-www-form-urlencoded format. Decoders that handle one and not the other are a common source of mangled values.
Which characters actually need encoding?
Anything outside the unreserved set — letters, digits, hyphen, underscore, dot and tilde — should be percent-encoded when it appears in a value. Reserved characters such as slash, question mark and ampersand only need encoding when they are part of a value rather than part of the URL structure.
Can I encode the same string twice?
You can, and it is a bug when it happens accidentally. Double encoding turns a percent sign into %25, so %20 becomes %2520 and the recipient sees a literal "%20" rather than a space. If a value arrives with visible percent codes in it, double encoding is the first thing to check.
Does this work on non-English characters?
Yes. Non-ASCII characters are converted to UTF-8 bytes first and each byte is percent-encoded, which is why a single accented character becomes two percent codes and many CJK characters become three.
Is anything sent to a server?
No. Encoding and decoding happen entirely in your browser.

References & Further Reading

By OnlineToolHubs Team • September 2026