URL Encode / Decode Online Free - Percent Encoding %20 %2F %26 (2026)
Every URL you send to API, paste into browser, or build in code must follow strict encoding rules. Single unencoded space or ampersand can break request silently. This guide explains what percent-encoding is, which characters require it, difference between encodeURIComponent + encodeURI, + how to encode or decode any URL instantly in browser without uploading anything.

Table of Contents
What URL percent-encoding + why it exists
URL can only contain limited set of characters from ASCII character set. Characters outside that set, or characters that carry special meaning in URL — like spaces, slashes, ampersands, + question marks — cannot appear in raw form inside certain URL components. When they do, URL becomes ambiguous or invalid.
Percent-encoding, formally defined in RFC 3986, solves this by substituting each problematic character with percent sign followed by two hexadecimal digits representing character's UTF-8 byte value. Space encoded as %20 because 20 hexadecimal representation of 32, ASCII code for space. Forward slash becomes %2F, ampersand becomes %26, + hash becomes %23.
You encounter percent-encoding every day without noticing it. When you search for something on Google + look at address bar, you see query transformed: spaces become + or %20, special characters become percent sequences. When you click link in email with tracking parameters, those parameters percent-encoded. When REST API receives query with user-submitted value, that value must be encoded to prevent parser from misinterpreting it.
Encoding reversible: percent-encoded string can always be decoded back to original form. Decoding process replaces each %XX sequence with character whose UTF-8 byte value XX in hexadecimal.
Reserved vs unreserved characters: full table
RFC 3986 divides URL characters into two groups. Unreserved characters safe to use in any URL component without encoding. Reserved characters have structural meaning + must be encoded when they appear as data rather than as URL delimiters.
| Category | Characters | Encode in data? | Notes |
|---|---|---|---|
| Unreserved | A-Z a-z 0-9 - _ . ~ | No — always safe | Never need encoding. Safe in every URL component. |
| Reserved — general | : / ? # [ ] @ | Yes — encode as data | Delimit scheme, host, path, query, fragment. Must encode when used as data. |
| Reserved — subcomponent | ! $ & ' ( ) * + , ; = | Yes — encode in query values | & separates parameters; = pairs keys + values. Encode when appearing inside value. |
| Non-ASCII (Unicode) | Chinese, Arabic, emoji, etc. | Always — UTF-8 byte encoding | Encoded as their UTF-8 byte sequence. Example: 中 → %E4%B8%AD. |
| Space | (ASCII 32) | Always — as %20 (or + in forms) | %20 RFC 3986 standard. + only valid in HTML form encoding contexts. |
Practical way to remember rule: if you embedding user-supplied value or any arbitrary string inside URL, encode every character except letters, digits, hyphen, underscore, period, + tilde. When in doubt, encode more rather than less — correctly encoded URL always works, but under-encoded one may silently misbehave.
encodeURIComponent vs encodeURI: when to use each
JavaScript provides two built-in functions for URL encoding, + choosing wrong one most common bugs in web development. Difference comes down to what they designed to encode.
encodeURIComponent designed to encode single component value — query parameter value, path segment, or any piece of data that will be embedded inside URL. It encodes all characters except: A-Z a-z 0-9 - _ . ! ~ * ' ( ). This means it encodes / ? # & = : @ — all structural URL characters. That exactly what you want when encoding value, because those characters must not be interpreted as URL structure.
encodeURI designed to encode complete URL while preserving its structure. It leaves unencoded all characters that have structural roles in URLs: ; , / ? : @ & = + $ # in addition to unreserved characters. This makes it useful only when you have full URL + want to encode non-ASCII characters or spaces without breaking its structure. You should never use encodeURI on parameter value that could contain & or = — those characters will pass through unencoded + corrupt query string.
| Function | Leaves unencoded | Use for | Do not use for |
|---|---|---|---|
| encodeURIComponent | A-Z a-z 0-9 - _ . ! ~ * ' ( ) | Query parameter values, path segments, any data embedded in URL | Full URLs — it encodes / + ? + breaks URL structure |
| encodeURI | A-Z a-z 0-9 - _ . ! ~ * ' ( ) ; , / ? : @ & = + $ # | Full URL with Unicode chars or spaces, where structure must be preserved | Parameter values — leaves & + = unencoded, corrupting query strings |
Practical rule: always use encodeURIComponent for parameter values. Use encodeURI only in rare case where you have complete URL (perhaps received from user input) + want to make it URL-safe without destroying its structure. In most codebases, encodeURIComponent right choice 95% of time.
%20 vs +: which to use for spaces
Both %20 + + can represent space in URL, but they belong to different encoding standards + not interchangeable in all contexts.
%20 RFC 3986 standard encoding for space. It produced by encodeURIComponent + valid in every URL component — path segments, query strings, fragment identifiers. It universally understood by every HTTP library, server, + language runtime.
+ as space representation comes from application/x-www-form-urlencoded MIME type — format browsers use when submitting HTML forms via GET or POST. In that context only, + in query string decoded as space. This convention predates RFC 3986. Outside of HTML form submissions, + literal plus sign, not space.
Safest rule: always use %20 (produced by encodeURIComponent) unless you explicitly building application/x-www-form-urlencoded data for HTML form. APIs that expect RFC 3986-compliant URLs will interpret + literally + search query "hello world" will arrive as "hello+world" instead.
Encode or decode URL parameter — runs 100% in browser
Native encodeURIComponent / decodeURIComponent. Spaces as %20. Handles Unicode, special characters, API tokens. No server.
Open URL Encoder / Decoder, FreeCommon characters + their percent-encoded values
Table below covers characters most frequently encountered when building URLs manually, constructing API requests, or debugging broken query strings. "Encoded form" column shows result of applying encodeURIComponent.
| Character | Encoded form | Why it matters |
|---|---|---|
| space | %20 | Not allowed in URLs. Most common encoding mistake. |
| / | %2F | Path delimiter. Encode when slash appears inside parameter value. |
| ? | %3F | Starts query string. Encode when it appears in value. |
| & | %26 | Separates query parameters. Critical to encode in values. |
| = | %3D | Separates key + value in query pairs. Encode when in value. |
| # | %23 | Fragment identifier delimiter. Raw # in value truncates query. |
| + | %2B | Ambiguous (space in forms, literal + in RFC 3986). Encode for safety. |
| % | %25 | Encoding escape character itself. Must encode literal percent signs. |
| @ | %40 | Used in user@host authority. Encode when in path or query value. |
| : | %3A | Scheme delimiter (https:). Encode in path or query component values. |
Double encoding: most common mistake
Double encoding happens when string that already percent-encoded gets encoded again. Most visible symptom: literal %25 appearing in URL where you expect %20 or another encoded character.
Here what happens step by step. Suppose user submits string hello world. You encode it once: hello%20world. Now if you pass that result to encodeURIComponent again — or if framework automatically encodes what you already encoded — % in %20 becomes %25, turning encoded space into hello%2520world. Server receives hello%20world as literal string — different value from user's original input.
Common sources of double encoding in real codebases:
- Manually encoding value before passing it to library that also encodes it internally. Axios, fetch, + most HTTP clients encode URL parameters automatically when you pass them as objects. If you pre-encode, they double-encode.
- Receiving already-encoded URL + passing it as parameter value. If you receive callback URL like
https://app.com/auth?token=abc+ encode it as redirect parameter, URL encoded. If you then pass that parameter value through encodeURIComponent again, it double-encodes. - String concatenation across multiple layers. Value encoded at API layer, passed to router, which encodes URL again, which passes it to redirect handler that encodes it one more time.
Fix simple: encode each raw value exactly once, as late as possible in URL construction process. If value arrives already encoded (from external source), decode it first with decodeURIComponent, then re-encode it as needed for specific context. Never assume encoding state of string received from outside system.
Check encoded string — decode + re-encode without double encoding
Paste suspicious URL to verify its encoding state. Decode then re-encode in one step. No server, no upload.
Encoding URL parameters for API requests
API requests where percent-encoding mistakes most costly. Missing or incorrect encoding can produce 400 Bad Request, return wrong data silently, or — in worst case — expose security vulnerability (open redirect, parameter injection). Here patterns that come up most often.
Building search query with spaces + special characters. User searches for "coffee & donuts". Raw string contains space + ampersand. You need to pass it as q parameter. Correct approach:
const query = "coffee & donuts"; const url = "https://api.example.com/search?q=" + encodeURIComponent(query); // Result: https://api.example.com/search?q=coffee%20%26%20donuts
Passing redirect URL as parameter. You want to redirect user back to URL after authentication. Redirect URL itself contains slashes, question marks, + more parameters. It must be fully encoded as single parameter value:
const redirectUrl = "https://app.com/dashboard?tab=settings&mode=edit"; const loginUrl = "https://auth.example.com/login?redirect=" + encodeURIComponent(redirectUrl); // Result: https://auth.example.com/login?redirect=https%3A%2F%2Fapp.com%2Fdashboard%3Ftab%3Dsettings%26mode%3Dedit
Multiple parameters constructed safely. Use URLSearchParams in JavaScript — it handles encoding automatically + correctly for each value:
const params = new URLSearchParams({
q: "coffee & donuts",
lang: "en",
page: "1",
});
const url = "https://api.example.com/search?" + params.toString();
// Result: https://api.example.com/search?q=coffee+%26+donuts&lang=en&page=1
// Note: URLSearchParams uses + for spaces (form encoding), not %20.
// For strict RFC 3986, use encodeURIComponent manually.Note that URLSearchParams uses application/x-www-form-urlencoded format, encoding spaces as + rather than %20. Most API servers accept both, but if target API requires strict RFC 3986 encoding, build query string manually with encodeURIComponent.
How to encode or decode URL online, step by step
- Open URL Encode / Decode tool. Go to omnikitbolt.com/tools/url-encode-decode in any modern browser. No signup, no extension required.
- Paste string. Paste URL, parameter value, or percent-encoded string into input field. For encoding: paste raw string with spaces + special characters. For decoding: paste percent-encoded string (e.g.
coffee%20%26%20donuts). - Click Encode or Decode. Encode converts raw string to its percent-encoded form using encodeURIComponent. Decode converts percent-encoded form back to original text using decodeURIComponent.
- Copy result. Click copy button. Output ready to paste into API call, code, terminal command, or browser address bar.
- Verify if needed. If you received percent-encoded string + want to confirm its decoded value, paste encoded form + click Decode. Result what server or application would receive after decoding.
Tool runs entirely in browser using JavaScript's native encodeURIComponent + decodeURIComponent functions. No data transmitted to any server. Sensitive strings — API keys embedded in URLs, OAuth tokens, internal endpoint paths — stay on device.
Related tools
- URL Encode / Decode: tool covered in this article. Encode or decode any URL or parameter value using native encodeURIComponent / decodeURIComponent. No upload, no server. See also: step-by-step encode / decode guide.
- Hash Generator: generate MD5, SHA-1, SHA-256, SHA-384, or SHA-512 hashes from text or files in browser. Useful for verifying file integrity or creating checksums. See hash generator guide.
- QR Code Generator: generate QR codes from any URL, text, Wi-Fi credentials, email, or vCard. No signup, no expiry. Download PNG or SVG. See QR code generator guide.
- Image to Base64: encode any image to Base64 for embedding in HTML, CSS, or API payloads. No upload, no server. See Image to Base64 guide.
Browser-based tools for developers — no upload, no server
Encode URLs, generate hashes, create QR codes, convert images — all client-side.
FAQ
What URL encoding (percent-encoding)?
URL encoding, also called percent-encoding, method for representing characters that not allowed or have special meaning in URLs. Each character replaced by percent sign followed by two hexadecimal digits representing character byte value in UTF-8. For example, space becomes %20, forward slash becomes %2F, + ampersand becomes %26. Encoding defined by RFC 3986 + required any time you include arbitrary data inside URL component such as query string or path segment.
What difference between encodeURIComponent + encodeURI?
encodeURIComponent encodes everything except letters, digits, + characters - _ . ! ~ * ' ( ). It designed to encode single component value — query parameter, path segment, or any piece of data that will be embedded inside URL. encodeURI encodes everything except letters, digits, + characters - _ . ! ~ * ' ( ) ; , / ? : @ & = + $ #. It preserves all characters that have structural meaning in URL, so it only appropriate when you want to encode full URL without breaking its structure. Most common mistake using encodeURI on parameter value that contains & or = — encodeURI leaves those characters unencoded, which breaks query string. Always use encodeURIComponent for individual parameter values.
Why does space sometimes appear as %20 + sometimes as +?
Both %20 + + represent space, but they come from different encoding standards. %20 RFC 3986 (URI) standard for space character in any URL component. + notation for spaces comes from older application/x-www-form-urlencoded format, used by HTML form submissions. When browser submits form via GET, spaces in form field values encoded as +. However, + only valid as space replacement inside query strings sent via HTML forms — it not valid in path segments, fragment identifiers, or in URLs consumed by APIs that follow strict RFC 3986. Safest practice: always use %20 (produced by encodeURIComponent) unless you explicitly constructing application/x-www-form-urlencoded form data.
What characters must be percent-encoded in URL?
RFC 3986 defines unreserved characters as safe in URLs without encoding: letters A-Z + a-z, digits 0-9, + four symbols hyphen (-), underscore (_), period (.), + tilde (~). All other characters should be percent-encoded in most URL components. Reserved characters — : / ? # [ ] @ ! $ & ' ( ) * + , ; = — have structural roles in URLs + must be encoded when they appear as data (not as structure). Practical examples: space in search query must be %20, ampersand in parameter value must be %26 (otherwise parser treats it as parameter separator), + hash in value must be %23 (otherwise parser treats it as fragment identifier).
What double encoding + how do I avoid it?
Double encoding occurs when string that already percent-encoded gets encoded again. For example, %20 (encoded space) becomes %2520 after second encode pass — because percent sign itself encoded as %25. This very common bug. It happens when you call encodeURIComponent on string that already encoded, or when library or framework encodes URL component automatically while you also encode it manually. To avoid it: encode each parameter value exactly once before adding it to URL. If you receive URL from external source + need to pass it as parameter value, decode it first with decodeURIComponent, then re-encode it as parameter value.
How do I encode URL with special characters for API request?
For API request, encode each parameter value individually using encodeURIComponent, then join them into query string. Example: if API takes parameters q (search term) + lang (language), + search term 'coffee & donuts', build URL as: baseUrl + '?q=' + encodeURIComponent('coffee & donuts') + '&lang=' + encodeURIComponent('en'). Result: https://api.example.com/search?q=coffee%20%26%20donuts&lang=en. Never encode full URL at once with encodeURI — it will leave & separating parameters unencoded but break embedded & characters in values.
Does this URL encoder upload data to server?
No. Omnikitbolt URL Encode / Decode tool runs 100% in browser using JavaScript native encodeURIComponent + decodeURIComponent functions. Nothing you type or paste transmitted anywhere. No server receives strings. This matters because query parameters sometimes contain tokens, API keys, passwords, or other sensitive credentials embedded in URLs. Open browser DevTools (F12), go to Network tab, + type or paste anything into tool — you will see no outgoing network requests carrying input.
Can I decode URL that contains Chinese, Arabic, or other non-ASCII characters?
Yes. Non-ASCII characters in URLs encoded as their UTF-8 byte sequence in percent notation. Chinese character like 中 has UTF-8 encoding E4 B8 AD, so it appears in URL as %E4%B8%AD. decodeURIComponent function handles full Unicode range — it decodes percent-encoded UTF-8 sequences back to original Unicode characters correctly. If you paste %E4%B8%AD into decode field, you will get 中. This standard way URLs represent Internationalized Domain Names (IDN) + Unicode path segments. Encode direction also works: type or paste any Unicode character + tool produces its correct UTF-8 percent-encoded form.