About this tool
The URL Encoder/Decoder handles percent-encoding for URLs. Supports both encodeURIComponent (for query parameters) and encodeURI (for full URLs). Decode percent-encoded strings back to readable text.
What percent-encoding is
URL encoding, formally called percent-encoding, is defined in RFC 3986. A URL may only contain a limited set of ASCII characters, so any byte outside that set is written as a percent sign followed by its two-digit hexadecimal value. A space becomes %20, an ampersand becomes %26, and a hash becomes %23. Non-ASCII text is first turned into its UTF-8 bytes, then each byte is percent-encoded, so the euro sign becomes %E2%82%AC.
Reserved vs unreserved characters
RFC 3986 sorts characters into two groups that decide what must be encoded. Unreserved characters are always safe and should never be encoded. Reserved characters carry structural meaning (they separate the parts of a URL), so they must be encoded when they appear inside a value rather than as a delimiter.
| Group | Characters | Encode? |
|---|---|---|
| Unreserved | A-Z a-z 0-9 - _ . ~ | Never |
| Reserved (gen-delims) | : / ? # [ ] @ | Inside a value |
| Reserved (sub-delims) | ! $ & ' ( ) * + , ; = | Inside a value |
| Everything else | space, accented letters, emoji, control bytes | Always |
encodeURIComponent vs encodeURI
JavaScript ships two encoders, and choosing the wrong one is the most common URL bug. encodeURIComponent escapes every reserved character, so it is correct for a single piece such as a query value or a path segment. encodeURI deliberately leaves the URL delimiters alone so you can hand it a whole address, which means it will not protect a value that itself contains an & or a ?.
| Character | encodeURI | encodeURIComponent |
|---|---|---|
| space | %20 | %20 |
| / | / (kept) | %2F |
| ? & = # | kept | %3F %26 %3D %23 |
| Best for | a whole URL | one query value or segment |
Neither function touches the unreserved set, and both encode space as %20. The encodeURIComponent button above matches the second column; the encodeURI button matches the first.
Form data and the + for space
There is a second, older scheme. When a browser submits an HTML form with the default application/x-www-form-urlencoded type, a space becomes a plus sign (+) rather than %20. The two are not interchangeable everywhere: in the path or in a true percent-encoded value a + is a literal plus, while in a form-encoded query string a + means space. A server that uses the wrong parser turns "a + b" into "a b" or "a b". When in doubt, encode space as %20, which is valid in both query and path.
Worked example: a search URL
Suppose you want a search link for the phrase café & bar. Encode only the value, not the whole URL:
encoded caf%C3%A9%20%26%20bar
final https://example.com/search?q=caf%C3%A9%20%26%20bar
The é is UTF-8 bytes C3 A9, the space is %20, and the & becomes %26 so the server does not read it as the start of a second parameter. If you had passed the entire string through encodeURI, the & would have survived unescaped and silently split your query. Paste the value into the tool above with the encodeURIComponent mode selected to reproduce this.
Edge cases and common pitfalls
- Double-encoding: running an already-encoded string through the encoder again turns every
%into%25, so%20becomes%2520and the link breaks. Decode once to check before re-encoding. - Encoding the whole URL: passing a full address to
encodeURIComponentescapes the://and the slashes, producing a single broken token. Encode the values, then assemble the URL. - The reserved set is not universal:
encodeURIComponentleaves! ' ( ) *unescaped, though some strict servers want them encoded. Encode those manually if a target rejects them. - + ambiguity:
decodeURIComponentdoes not turn+back into a space. If the data came from a form, replace+with a space before decoding.
Percent-encoded values often start life as binary. Convert that binary to a safe string with the Base64 encoder and decoder first, inspect a token's claims with the JWT decoder, then tidy any returned object using the JSON formatter and validator.
Frequently asked questions
encodeURI vs encodeURIComponent?
encodeURI preserves URL structure characters (:/?#&). encodeURIComponent encodes everything - use it for parameter values.
Should a space be %20 or a plus sign?
Both occur. RFC 3986 percent-encoding uses %20 in the path and query. The older application/x-www-form-urlencoded scheme, used by default HTML form submissions, uses + for a space in the query string. %20 is valid in both places, so prefer it when unsure.
Why is my URL showing %2520 instead of %20?
That is double-encoding. The string was already percent-encoded, then encoded again, so the % in %20 became %25 and you got %2520. Decode the value once before re-encoding it.
Which characters never need URL encoding?
The unreserved set from RFC 3986: A-Z, a-z, 0-9, and the four symbols hyphen, underscore, period, and tilde. encodeURIComponent leaves all of these untouched.
Is the URL Encoder / Decoder accurate?
The URL Encoder / Decoder applies the standard formula for url encoder / decoder. Accuracy is limited only by your input precision. For decisions with material consequences, use the result as a starting point and verify with a qualified professional or the relevant official source.
Is the URL Encoder / Decoder free?
Yes. 100% free, no signup, no payment, no API key. The site is funded by display ads that appear around the tool but not inside the calculation flow.
Are my inputs saved?
No. Inputs stay in your browser tab. Closing the tab discards them. The site uses Google Analytics for traffic measurement (anonymized) but does not see what you type into the form.
Can I use the URL Encoder / Decoder on my phone?
Yes. The tool is responsive and tested on iOS Safari, Android Chrome, and major desktop browsers. Touch targets meet Apple's 44pt and Google's 48dp minimum guidance.
How do I report a bug or suggest improvement to the URL Encoder / Decoder?
Email hi@3tej.com with the URL of this page and a description of what you saw vs expected. We typically respond within 72 hours and update calculators when rules or formulas change.
How accurate is the URL Encoder / Decoder?
It applies the standard formula. Accuracy is limited only by your input precision. For decisions with material consequences (taxes, medical, legal, structural), use the result as a starting point and verify with a qualified professional in the relevant field.
Is the URL Encoder / Decoder free to use?
Yes. 100% free, no signup, no payment, no API key. The site is funded by display ads around the tool but not inside the calculation flow.
Are my inputs saved anywhere?
No. All inputs stay in your browser tab. Closing the tab discards them. The site uses Google Analytics for traffic measurement (anonymized) but the analytics never see what you type into the form.
Does the URL Encoder / Decoder work offline?
Yes. Once the page has loaded, it works without internet. The calculation runs in JavaScript on your device.
Can I share results from the URL Encoder / Decoder?
Take a screenshot or copy the output. The page doesn't generate shareable URLs for specific calculations - inputs stay in your browser only.
Why are the results different from another url encoder / decoder tool?
Most likely: different formula assumptions, different default values, different rounding rules, or different applicable rates. Check the methodology if both tools document it. Both can be valid for different scenarios.
