Encode & Decode URLs & Percent-Encoded Query Strings
Encode or decode URLs and query strings with percent-encoding. Choose encodeURIComponent or encodeURI behavior.
- No upload
- No signup
- Free
Loading tool…
Your file stays in this browser. Nothing is uploaded.
Loading tool…
Your file stays in this browser. Nothing is uploaded.
How URL Encoder & Decoder works
Browser Toolset URL Encoder & Decoder converts special characters into percent-encoded strings and decodes encoded URLs back to human-readable text client-side. Fast, private, and handles full URLs or query components.
How to use this tool
- Select mode (Encode or Decode).
- For encoding, choose between encodeURIComponent (query params) or encodeURI (full URLs).
- Paste your text or URL into the input area.
- View the instant encoded or decoded result.
- Click "Copy Result" to copy your output to clipboard.
Common uses
- Web developers encoding query parameters for REST APIs and webhook payloads.
- Digital marketers decoding percent-encoded UTM campaign tracking parameters.
- Security engineers analyzing encoded payloads and redirects.
- Fixing broken links containing foreign language characters and spaces.
Frequently asked questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps URL structure characters such as : / ? & = and #, while encodeURIComponent encodes them too, making it the right choice for query string parameter values. Both leave letters, digits and a few symbols (- _ . ! ~ * ' ( )) as they are.
Why do URLs need percent encoding?
URLs can only be transmitted over the internet using standard ASCII characters; spaces, non-ASCII characters, and reserved symbols must be replaced with percent signs followed by hex codes (e.g. %20 for space).
Are my URLs or query parameters logged anywhere?
No. Encoding and decoding use your browser's built-in encodeURIComponent, encodeURI and decodeURIComponent, and the text is not uploaded. Anything you paste stays on the page until you clear or reload it.
Can it decode malformed URI sequences safely?
It does not crash. If the input has a malformed sequence (for example a lone % sign), the output box stays empty and a red message below it reads "Malformed URI sequence: the input contains a stray % or invalid escape." Fix the input first; decoding always uses decodeURIComponent.
Can I swap input and output with one click?
Yes. Swap copies the current output into the input box and switches between Encode and Decode, so you can check a round trip. It does nothing while the output shows an error.
Details and limits
Special characters, spaces, and non-ASCII glyphs can break web URLs if not properly escaped. Our URL Encoder & Decoder encodes and decodes query parameters in your browser, and the text you paste is not uploaded.
What each mode does to your text
Encoding and decoding call the browser's own functions, so the output matches what JavaScript produces. The result updates as you type, nothing is sent anywhere, and the page opens on a sample address that contains spaces and an ampersand. The encodeURIComponent method percent-encodes everything except letters, digits and - _ . ! ~ * ' ( ), including / ? : & = # and +. That suits a single value placed inside a query string or path segment. The encodeURI method also leaves the characters that give a full address its shape, such as : / ? # & = + , ; @ and $, while still encoding spaces, quotes and non-ASCII letters.
Decode mode always uses decodeURIComponent. It turns %XX sequences back into characters, including multi-byte UTF-8 sequences for accented letters and emoji, but it does not turn a plus sign into a space.
Features and limits
- An Encode and Decode toggle. The Method dropdown appears in Encode mode only, and Decode has no method choice.
- Non-ASCII text is encoded as UTF-8 bytes, so é becomes %C3%A9.
- Input that is already encoded is encoded again: the percent sign becomes %25, so a space encoded twice ends up as %2520. Decode once for each layer.
- Swap moves the output into the input and flips the mode. The Method dropdown keeps its last setting.
- A malformed sequence, such as a stray percent sign or a half of a multi-byte character, shows a red Malformed URI sequence message under the output box and leaves the output empty. Copy Result is disabled and Swap does nothing until the input is fixed.
- The whole box is handled as one string. Query parameters are not split into a table and lines are not treated separately.
Choosing the right method
Pick the method by what you are encoding. For a parameter value, such as a return address stored inside another URL, use encodeURIComponent, otherwise an ampersand or equals sign in the value is read as a separator. For a complete address that only needs spaces and non-ASCII characters made safe, use encodeURI so the scheme and slashes survive. Running encodeURIComponent over a whole URL turns https:// into https%3A%2F%2F, which is rarely what you want.
HTML form submissions write spaces as a plus sign instead of %20. If decoded text shows plus signs where spaces belong, replace them afterwards with the Find and Replace Text tool. For binary data or arbitrary text use Base64 Studio (Text & Files), for tagged campaign links the UTM Campaign URL Builder, and for testing patterns against decoded strings the Regex Tester & Debugger.