RFC 3986 percent-encodingReviewed 29 Sep 2026Runs in your browser

URL Encoder & Decoder

Encode or decode URLs and query strings with percent-encoding. Choose component or full-URL encoding, pick %20 or + for spaces, and see every query parameter split out with its encoded form.

Who wrote it

Written by Suhaib Hassan. Figures are estimates you can edit. Our methodology.

How the engine works

It uses the browser's own encodeURIComponent, encodeURI and decodeURIComponent, with options for strict escaping and form-style spaces.

Why we built it

Broken links are often an encoding problem. This shows what changed and which parts of a URL are affected.

Text to encode or decode

0 characters
Examples
Encoded result—
—

—

Input characters—
Output characters—
Reserved characters escaped—
Non-ASCII bytes encoded—
Query parameters found—
KeyValueEncoded

Which characters get percent-encoded

Percent-encoding writes a character as % followed by the hexadecimal value of each of its UTF-8 bytes. encodeURI() keeps characters that structure a URL. encodeURIComponent() encodes them, which is what you want for a single query value.

CharacterPercent formRFC 3986 classencodeURIencodeURIComponent
space%20Not allowed%20%20
!%21Sub-delimKeptKept
"%22Not allowed%22%22
#%23Gen-delimKept%23
$%24Sub-delimKept%24
%%25Not allowed%25%25
&%26Sub-delimKept%26
'%27Sub-delimKeptKept
(%28Sub-delimKeptKept
)%29Sub-delimKeptKept
*%2ASub-delimKeptKept
+%2BSub-delimKept%2B
,%2CSub-delimKept%2C
/%2FGen-delimKept%2F
:%3AGen-delimKept%3A
;%3BSub-delimKept%3B
<%3CNot allowed%3C%3C
=%3DSub-delimKept%3D
>%3ENot allowed%3E%3E
?%3FGen-delimKept%3F
@%40Gen-delimKept%40
[%5BGen-delim%5B%5B
\%5CNot allowed%5C%5C
]%5DGen-delim%5D%5D
^%5ENot allowed%5E%5E
`%60Not allowed%60%60
{%7BNot allowed%7B%7B
|%7CNot allowed%7C%7C
}%7DNot allowed%7D%7D
~%7EUnreservedKeptKept
³%C2%B3Unreserved%C2%B3%C2%B3

Formulas

How the numbers are worked out.

Percent-encoding

Each byte of the character's UTF-8 form becomes a percent sign and two hexadecimal digits.

%C2%B3 = ³ (two UTF-8 bytes)
space = %20

Component or full URL

Encode a single value with the component option. Encode a whole address with the full URL option so : / ? & = # stay as they are.

encodeURIComponent(value)
encodeURI(url)

Decoding

Each %XX sequence is turned back into its byte, and bytes are read as UTF-8.

decodeURIComponent(text)

Worked examples

Illustrative figures, each checked by hand. The first is the default setup.

A query value

Encode the component "gas leak & m³/hr".

space → %20, & → %26, ³ → %C2%B3, / → %2F
result: gas%20leak%20%26%20m%C2%B3%2Fhr

A full URL

Encode "https://example.com/a b?x=1".

only the space changes: https://example.com/a%20b?x=1

Decode

Decode "caf%C3%A9%20menu".

%C3%A9 = é and %20 = space: café menu

How to encode or decode a URL

  • Choose Encode a component, Encode a full URL or Decode.
  • Paste your text. Use the examples to see typical cases.
  • Copy the result, or use it as the next input to round-trip.
  • Check the table for each query parameter.

Encoding turns text into a safe form for URLs. It is not encryption and hides nothing. Never put secrets in a URL.

By Suhaib Hassan · Reviewed 29 September 2026 · How CalculatePilot verifies formulas →

Sources

  • IETF, RFC 3986, Uniform Resource Identifier (URI): Generic Syntax (2005).
  • WHATWG, URL Standard, percent-encoding.
  • MDN Web Docs, encodeURIComponent() and encodeURI().

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI keeps characters such as : / ? & = # so a whole address still works. encodeURIComponent encodes them, so use it for a single value inside a URL.

When should a space be %20 and when +?

%20 is correct everywhere in a URL. A + means a space only in HTML form data (application/x-www-form-urlencoded), such as query strings from forms.

Why does ³ become %C2%B3?

Non-ASCII characters are first turned into UTF-8 bytes, and each byte is written in hex. ³ is the two bytes C2 and B3.

Why does decoding fail with a malformed error?

A % must be followed by two hexadecimal digits, and the bytes must form valid UTF-8. A stray % or truncated sequence causes this.

Is this data sent anywhere?

No. Everything runs in your browser.

Related calculators

More everyday tools.

All Everyday Calculators

Embed This URL Encode Decode

Free and responsive, and it runs in the visitor's browser. Branding removal from $7.99/month.

<iframe src="https://www.calculatepilot.com/embed/url-encode-decode.html" width="100%" height="560" loading="lazy" title="URL Encode Decode"></iframe>
For website owners

Want this calculator on your own website?

Embed it in one line of code. Keep it free with a small CalculatePilot attribution link, or go white-label: your brand, no attribution, one license for all your domains.

  • All 159 calculators, unlimited embeds
  • Works on WordPress, Webflow, Squarespace, Wix and plain HTML
  • Runs in your visitor's browser, so nothing is sent to a server
  • License key emailed automatically after checkout, cancel anytime
$7.99 / month
or $89.99 / year · white-label Pro
Get the white-label license Embed free with attribution