Percent-encode or decode URLs and query strings — free, instant, private.
What is URL encoding?
URL encoding — officially called percent-encoding — converts characters that are not allowed
in a URL into a safe form: a percent sign followed by two hexadecimal digits representing the
character's UTF-8 bytes. A space becomes %20, an ampersand becomes
%26, and non-ASCII text such as é becomes
%C3%A9. This tool encodes and decodes text instantly, entirely in your browser.
How to use this tool
- Paste the text or URL you want to convert into the input box above.
- Pick a mode: Component for a single query-string value, or Full URL to keep a whole address intact.
- Click Encode or Decode — or leave Live on to convert as you type.
- Copy the result with one click.
Reserved vs unreserved characters
- Unreserved (never encoded): A–Z, a–z, 0–9 and - _ . ~
- Reserved (special meaning in a URL): : / ? # [ ] @ ! $ & ' ( ) * + , ; =
- encodeURI leaves reserved characters intact, so a full URL keeps working.
- encodeURIComponent encodes reserved characters too, so a value can sit safely inside a query string.
Common mistakes (and how to fix them)
- Double-encoding. Running Encode on text that is already encoded turns every percent sign into
%25, so %20 becomes %2520 and the value later decodes to the literal text %20 instead of a space. Fix: press Decode first; if the output still contains percent sequences, it was encoded more than once.
- Encoding a whole address in Component mode. Component mode also encodes
: and /, so https://example.com becomes https%3A%2F%2Fexample.com, which no longer works as a link. Switch to Full URL mode to keep the structure intact.
- The plus-sign trap. HTML forms send spaces as
+ (application/x-www-form-urlencoded), but decodeURIComponent leaves + untouched. If decoding gives hello+world, replace each + with %20 before decoding, or encode spaces as %20 from the start.
Worked example: a URL inside a URL
Embedding one address in another, as in ?redirect=https://example.com/a?x=1&y=2, breaks because the inner ? and & are parsed as part of the outer query string. Paste just the inner address, select Component mode, and Encode produces https%3A%2F%2Fexample.com%2Fa%3Fx%3D1%26y%3D2, which travels safely as a single value. On the receiving side, Decode in the same mode restores it exactly.
Frequently asked questions
What is percent-encoding?
Percent-encoding is the standard mechanism (RFC 3986) for representing characters in a URL that would otherwise be unsafe or ambiguous. Each such character is replaced by a percent sign followed by two hexadecimal digits of its UTF-8 byte value — for example, a space becomes %20 and an ampersand becomes %26.
What is the difference between encodeURI and encodeURIComponent?
encodeURI is meant for a complete URL: it encodes unsafe characters but leaves structural characters such as : / ? & = # intact so the address still works. encodeURIComponent is meant for a single piece of data, like a query parameter value: it encodes every reserved character too, so the value cannot break the surrounding URL.
Which characters are reserved in a URL?
The reserved characters are : / ? # [ ] @ ! $ & ' ( ) * + , ; = — they have structural meanings such as separating the scheme, path, query and fragment. The unreserved characters A-Z a-z 0-9 - _ . ~ are never encoded. Everything else, including spaces and non-ASCII text, must be percent-encoded.
Is URL encoding reversible?
Yes. Decoding with decodeURIComponent (or decodeURI) restores the original text exactly, provided the percent-sequences are well-formed. If the input contains a malformed sequence such as a lone % sign, decoding fails — this tool detects that and shows a clear error instead of guessing.