Quick Answer
- Paste your text into the Encode tab (or encoded text into the Decode tab).
- Choose an encode type: URL for full URLs, Component for query param values, HTML for HTML entities.
- Click Copy to save the real-time encoded output to your clipboard.
- Use the Batch tab to process multiple values at once — one value per line.
URL Encoder & Decoder — Free
Four encode types, HTML entity support, batch mode, real-time output — all in your browser, no sign-up.
Open URL Encoder →URLs can only contain a limited set of characters. Everything else — spaces, accented letters, special symbols, non-ASCII text — must be converted to percent-encoded form before being placed in a URL. The reverse operation, decoding, converts those percent sequences back to readable text. Understanding which encoder to use (and when) saves hours of debugging broken links and malformed API requests.
Advertisement
What Is URL Encoding (Percent Encoding)?
URL encoding replaces each unsafe or reserved character with a % sign followed by the character's two-digit hexadecimal ASCII or UTF-8 code. A few common examples:
| Character | Encoded (percent) | Common context |
|---|---|---|
| (space) | %20 | Query values, path segments |
| & | %26 | Query parameter values |
| = | %3D | Query parameter values |
| ? | %3F | Query parameter values |
| # | %23 | Fragment identifiers in values |
| + | %2B | Literal plus signs in values |
| / | %2F | Path separators in values |
| @ | %40 | Email addresses in URLs |
| é (U+00E9) | %C3%A9 | Non-ASCII characters (UTF-8) |
| 中 (U+4E2D) | %E4%B8%AD | Chinese characters (UTF-8) |
encodeURI vs encodeURIComponent: Which to Use
This is the question developers get wrong most often. The difference is which characters each function leaves alone:
| Function | Does NOT encode | Use when |
|---|---|---|
| encodeURI | A–Z a–z 0–9 ; , / ? : @ & = + $ - _ . ! ~ * ' ( ) # | Encoding a complete URL that must remain structurally valid (e.g., adding UTM params to a known-good URL) |
| encodeURIComponent | A–Z a–z 0–9 - _ . ! ~ * ' ( ) | Encoding an individual query parameter value, path segment, or any value that will be embedded inside a URL |
| HTML encode | Alphanumeric characters | Safely inserting user text into HTML — prevents XSS via < > & " sequences |
| Custom | Everything except the characters you specify | Encoding only specific characters for a non-standard system or legacy API |
Practical rule
When in doubt, use encodeURIComponent. If you are encoding individual values that goinside a URL (query parameter values, path segments, form fields), Component is almost always the correct choice. Use encodeURI only when you have an already-valid URL and just want to make it safe to pass to another system.
Example:
// You want to build: https://example.com/search?q=hello world&lang=en
// WRONG — encodeURI leaves & and = alone, so it encodes the full query string as a value:
encodeURI("hello world&lang=en") // → "hello%20world&lang=en"
// CORRECT — encodeURIComponent encodes & and = inside the value:
"https://example.com/search?q=" + encodeURIComponent("hello world") + "&lang=en"
// → "https://example.com/search?q=hello%20world&lang=en"Decode Modes
The Decode tab offers four modes corresponding to the four encode types:
- URL — runs
decodeURI(). Use this to reverse a full URL that was encoded withencodeURI(). - Component — runs
decodeURIComponent(). Use this for individual query parameter values, form data, or anything encoded withencodeURIComponent(). - HTML — converts HTML entities back to characters (
&→&, etc.). - Multiple passes — repeatedly decodes until the output stabilises. Useful for strings that have been double- or triple-encoded. The tool reports how many decode passes were required.
Batch Encoding and Decoding
The Batch tab processes multiple values in a single operation. Paste one URL or string per line, choose encode or decode, and the tool produces one result per line. This is useful for:
- Sanitising a list of user-submitted URLs before inserting them into a database.
- Decoding a log file full of percent-encoded request paths.
- Encoding a list of query parameter values for an API integration.
- Preparing tracking URLs with encoded campaign parameters.
Enable Line Numbers to preserve the line-to-result mapping when the output order matters. Click Download to save the result as a text file.
Common URL Encoding Mistakes
Double-encoding
Double-encoding happens when an already-encoded string gets encoded again: hello%20world becomes hello%2520world(the % itself is encoded as %25). APIs will receive the literal percent signs instead of spaces. Fix it by using the Multiple Passes decode mode to unwrap all layers, then re-encode only once.
Using the wrong encode function for the context
Using encodeURI on a query parameter value leaves &, =, and ? unencoded, which breaks the URL structure when the value itself contains those characters. Always use encodeURIComponent for individual values.
Encoding an entire URL that is already valid
If you encode a full URL with encodeURIComponent, the colons, slashes, and question marks that define the URL structure get encoded — making the whole string useless as a link. Use encodeURI if you need to encode an already-valid full URL, or better yet, build the URL piece by piece using encodeURIComponenton each query value individually.
URL Encoder & Decoder — Free
Free URL Encoder — four encode types, HTML entity support, batch mode, real-time output. No sign-up.
Open URL Encoder →