URL Encoder / Decoder
Convert special characters to percent-encoding for safe use in URLs, or decode %20-style strings back into readable text. Switch between encodeURIComponent and encodeURI depending on whether you're encoding a value or a whole URL. Runs entirely in your browser.
Plain Text / URL
Encoded
encodeURIComponent escapes everything reserved (use for query values). encodeURI keeps / ? & = intact (use for whole URLs).
How to Use URL Encoder / Decoder
Pick Encode or Decode
Choose Encode to percent-encode text, or Decode to convert an encoded URL back into readable form.
Select the encoding style
For single values like query parameters, keep encodeURIComponent. For complete URLs, switch to encodeURI so slashes and question marks stay intact.
Paste and copy
Enter your text — the result appears instantly in the output panel. Click Copy Output to grab it for your code or browser.
About URL Encoder / Decoder
Why URLs need encoding
URLs can only contain a limited set of characters. Spaces, ampersands, question marks, slashes, quotes, and all non-ASCII characters have special meanings or aren't allowed at all, so they must be percent-encoded — replaced with a % followed by the character's byte value in hex. A space becomes %20, an ampersand becomes %26, and so on. Skipping this step is a classic source of bugs: query parameters get silently truncated at the first &, spaces break links entirely, and international characters corrupt in transit.
encodeURIComponent vs encodeURI
These two JavaScript functions differ in what they leave alone. encodeURIComponent escapes nearly everything, including / ? & = and # — use it when encoding a single value that will be placed inside a URL, like a query parameter or path segment. encodeURI preserves those structural characters — use it when encoding a complete URL that already has its structure in place and you just need to fix spaces and special characters. Using the wrong one is a frequent bug: encodeURI on a query value leaves & unescaped and splits your parameter.
Decoding and debugging
Decode mode reverses percent-encoding using decodeURIComponent, turning %20 back into spaces and %C3%A9 back into é. It's the fastest way to read long tracking URLs, inspect OAuth redirect parameters, or figure out what a form actually submitted. If your input contains a stray % that isn't followed by two hex digits, the tool shows a clear malformed-URI error instead of failing silently. Everything runs client-side in your browser — URLs you paste, which often contain session tokens, are never sent anywhere.
Common uses for URL Encoder / Decoder
- Encode search terms and user input before building query strings
- Decode long tracking or OAuth redirect URLs to see what they actually contain
- Fix broken links caused by unencoded spaces and special characters
- Prepare callback URLs for API configurations that require encoded values
- Debug webhook payloads and form submissions with percent-encoded data
Frequently Asked Questions
Which mode should I use for a query parameter?
Use encodeURIComponent. It escapes the characters that have structural meaning in URLs — & = ? / # — so your value stays intact as a single parameter. If you used encodeURI on a value containing an ampersand, the server would interpret everything after the & as a new parameter, silently corrupting your data.
Why does decoding fail with a malformed URI error?
Percent signs in the input must be followed by exactly two hexadecimal digits. A literal % — common in text about discounts or in double-encoded strings — breaks this rule. Check for stray % characters, or if the string was encoded twice, decode it, then decode the result again. The tool reports the error clearly instead of returning a wrong answer.
What's the difference between %20 and + for spaces?
Both represent a space, but in different contexts. %20 is the standard percent-encoding used everywhere in URLs. The + convention only applies inside query strings using the application/x-www-form-urlencoded format, which is what HTML forms submit. This tool uses %20, which is always safe. If you're decoding form data containing +, replace those with spaces first.
Does this handle international characters?
Yes. Non-ASCII characters are encoded as their UTF-8 byte sequences — é becomes %C3%A9, and emoji become four-byte sequences like %F0%9F%9A%80. This is the modern standard that browsers and servers expect. Decoding reverses it correctly, so you can safely round-trip URLs containing any language or symbol.
Is anything I paste uploaded?
No. Encoding and decoding run entirely in your browser with JavaScript — nothing is transmitted, stored, or logged. That matters here because URLs routinely embed session IDs, tokens, and email addresses in their parameters. You can paste production URLs for debugging without exposing them to any third party, including us.