What is percent-encoding?
A URL can only contain a small, safe alphabet: letters, digits and a
handful of symbols. But URLs constantly need to carry things outside
that alphabet — a search query with spaces and an ampersand, a filename
in Chinese, a redirect target that is itself a URL. Percent-encoding is
the escape hatch: any byte that cannot appear literally is written as a
percent sign followed by two hexadecimal digits giving its value, so a
space becomes %20 and the byte 0xE4 becomes
%E4. It is the same idea as backslash escapes in a string
literal, standardised for the one string format the whole web shares.
Every browser, server framework and HTTP library implements it, which
is exactly why its details matter: two implementations that disagree
about one character produce links that break in only one direction.
How to use this tool
- Paste your text or encoded string into the box above.
- Choose the mode. Component is right for a single value that will live inside a URL (a query parameter, a path segment): it encodes
/ ? & =too. Full URL is for an existing URL that needs to become legal: it keeps the structure and encodes only what cannot appear. - Press Encode or Decode. Decoding reports the exact position of a malformed
%sequence instead of failing silently. - When decoding form submissions, tick Read + as space — the rest of the time, leave it off, because in a standards-based URL a plus sign is a plus sign.
Reserved, unreserved, and who gets encoded
RFC 3986 splits characters into three castes. Unreserved
characters (A–Z a–z 0–9 - . _ ~) are always safe and never
need encoding. Reserved characters
(: / ? # [ ] @ ! $ & ' ( ) * + , ; =) are the URL's
punctuation: they mean something where they stand, so to use one as
mere data — an ampersand inside a company name, a slash inside a
filename — it must be percent-encoded. Everything else, including all
non-ASCII text, is encoded byte by byte as UTF-8. Component mode
encodes the reserved set; full-URL mode trusts that your reserved
characters are punctuation and leaves them working. Picking the wrong
mode is the single most common URL bug in production code: an
unencoded & in a value quietly splits one parameter
into two, and the debugging session starts two subsystems away from
the cause.
Examples
The query value Lovelace & Byrd: 100€? encodes in Component mode to:
Lovelace%20%26%20Byrd%3A%20100%E2%82%AC%3F
Note the ampersand became %26 (it can no longer split
parameters), the euro sign became three percent-encoded UTF-8 bytes,
and the question mark became %3F so it cannot start a
second query string. The full URL
https://example.com/search?q=café menu in Full URL mode
keeps every structural character and encodes just the é and the space:
https://example.com/search?q=caf%C3%A9%20menu
If a string you decode comes back with %20 still visible
in it, it was encoded twice — decode it once more and you will see the
singly-encoded original.