How is the result calculated?
A search query that breaks a URL
The text "q=top 10 tools & free ones" cannot sit raw in a URL — the spaces, ampersand, and equals sign would be read as URL structure. Encoding it produces q%3Dtop%2010%20tools%20%26%20free%20ones, a safe query value that decodes back byte-for-byte.
Example input and output | Input | Value |
| mode | encode |
| input | q=top 10 tools & free ones |
| Result | q%3Dtop%2010%20tools%20%26%20free%20ones |
What is the formula and its assumptions?
Percent-encoding (encode)
encoded = encodeURIComponent(text)
Formula terms | Symbol | Meaning |
encodeURIComponent | the platform function that escapes every reserved and non-ASCII character as %xx UTF-8 sequences |
text | the raw string you paste |
Escapes all reserved characters (including : / ? & =), which is the correct choice for a single query parameter or path segment and guarantees a lossless round trip.
Decoding
decoded = decodeURIComponent(encoded)
Formula terms | Symbol | Meaning |
decodeURIComponent | the platform function that reverses percent-encoding, converting each %xx sequence back to its byte |
Malformed input (incomplete or invalid %-escapes) raises an error the tool reports.
What are the most common mistakes?
- Encoding a whole URL with encodeURIComponent and getting %3A%2F%2F — encode whole URLs with encodeURI semantics or, better, encode only the parameter values.
- Assuming + means a space when decoding query strings: percent-encoded spaces are %20, and only form-encoded strings use +.
- Pasting percent-encoded strings into an online converter that uploads them — this tool is fully local.
What are the assumptions and limitations?
- The tool implements percent-encoding (encodeURIComponent/decodeURIComponent), not the +-for-space application/x-www-form-urlencoded format.
- Decode is strict by design: malformed input is rejected with an error rather than partially decoded.
- The mode (encode or decode) is explicit — the tool does not auto-detect which direction an input needs.
Where do the numbers come from?
Last reviewed August 11, 2026 · Version 1.0.0 · Toolivaro does not guarantee external content.
Frequently asked questions
What is the difference between encodeURIComponent and encodeURI?
encodeURIComponent escapes every reserved character — including : / ? & = — so its output can never be mistaken for URL structure. encodeURI leaves those characters intact for whole URLs. For a single parameter value or path segment, encodeURIComponent is the correct and safe choice, and it is what this tool uses.
Why do spaces become %20 and not +?
Percent-encoding uses %20 for a space. The + sign is a space only in the older application/x-www-form-urlencoded form encoding (HTML forms and query strings in some stacks). The tool follows the encodeURIComponent standard, where a space is always %20 — and + stays +.
Is it safe to paste API keys and signed URLs here?
Yes. The tool runs entirely in your browser: the input never leaves the page, is not uploaded, logged, or stored, and the same is true of the output. Nothing here makes a network request with your data.
Why does decoding sometimes fail?
decodeURIComponent throws when it meets an incomplete or invalid escape — a % that is not followed by two hex digits, or a truncated sequence. That usually means the string was never percent-encoded, or was cut off mid-escape. The tool shows the error instead of guessing at a partial result.
Part of Password, hashing, and security tools
Found a mistake or have a correction? Report it — we review every correction.
Reviewed by the Toolivaro editorial team per our methodology Methodology · Editorial policy