URL Encoder
Encode any URL or text to percent-encoding instantly in your browser. Follows RFC 3986. Free, no sign-up required.
Updated May 2026
URL encoding replaces unsafe ASCII characters with a "%" followed by two hexadecimal digits. This is crucial for passing data in the query string.
How this URL encoder online works
Three steps, done in seconds
1. Paste the URL or text
The percent-encoded output appears immediately, with a live character counter.
2. Pick the options
"Encode reserved characters" (`encodeURIComponent`) or keep `/ ? &` intact; "Space as +" for form submissions.
3. Copy the result
Click Copy or press Shift+Enter to grab the encoded string.
What this URL encoding tool does
Two modes, one extra option
Encode reserved characters
encodeURIComponent mode — encodes everything except A–Z a–z 0–9 - _ . ~. Best for query string values.
Preserve reserved characters
Keeps / ? # & = untouched — for encoding a full URL without breaking its structure.
Space as +
Replaces %20 with +, the format required by application/x-www-form-urlencoded.
100% client-side
Runs on encodeURIComponent()/encodeURI() locally — nothing is sent to any server.
Examples
When you'll need to percent encode a URL
The scenarios that come up most
Query string parameter
hello world has to become hello%20world before it goes into a URL, or it breaks on most servers.
URL nested inside a parameter
A ?redirect=https://... needs the inner URL fully encoded so it doesn't get parsed as part of the outer one.
Form submission
application/x-www-form-urlencoded requires spaces as + and special characters percent-encoded.
API request signing
AWS Signature V4 and OAuth 1.0a both require specific percent-encoding before you compute the HMAC.
Something off? Start here
Encoding the entire URL
Running https://api.com/search?q=x through encodeURIComponent as one string breaks /, ? and = — encode only the parameter values, not the whole URL.
encodeURI vs encodeURIComponent
encodeURI preserves / ? #; encodeURIComponent encodes those too. Using the wrong one leaves &/= unescaped inside a parameter value, or over-escapes a full URL.
Double encoding
If the input already contains %20, the % itself gets encoded to %25, producing %2520. Always start from the raw, unencoded string.
+ inside a path segment
The plus-for-space convention only applies inside query strings — in a URL path, + is a literal plus sign.
Why encode a URL here
Everything runs locally in JavaScript — nothing is transmitted anywhere, and you can verify that yourself in the browser's network tab.
Switching between the two modes (encode vs. preserve reserved characters) removes the recurring confusion between encodeURI and encodeURIComponent, and the space-as-+ toggle covers the form-encoding case without having to remember the rule.
Quick Tools vs. the browser console
Same function, different experience
Frequently asked questions
encodeURI preserves structural characters (/ ? # & =) and is meant for encoding a full URL. encodeURIComponent encodes those too and is meant for a single value, like one query string parameter.
References
Related Tools
- URL Decoder Developer Decode any percent-encoded URL or string back to plain text instantly in your browser. Follows RFC 3986. Free, no sign-up required.
- Base64 Encoder Developer Encode any text or string to Base64 instantly in your browser. Supports UTF-8, shows character count and output payload size. Free, no signup, 100% client-side.
- HTML Entity Encoder Developer Encode text to HTML entities online — escape special characters like <, >, &, and " instantly in your browser. No install needed.
- Image to Base64 Developer Upload any image and convert it to a Base64 data URL ready for HTML, CSS, or JSON — free online converter supporting PNG, JPEG, SVG, WebP. No server upload.
- Base64 Decoder Developer Free online Base64 decoder — decode Base64 strings back to plain text instantly in your browser. Validates input and shows decoded payload size.