URL Encoder and Decoder
Percent-encode a URL or a query value, or turn a percent-encoded string back into readable text.
How to encode or decode a URL
- Paste the URL, query string or value you want to convert.
- Tick Encode a whole URL if the input is a complete address and you want its structure preserved. Leave it unticked for a single value such as a search term or a redirect target.
- Press Encode to escape the unsafe characters, or Decode to turn a percent-encoded string back into text.
- Copy the result or download it.
Why URLs need encoding at all
A URL is built from a small set of reserved characters — the colon, the slashes, the question mark, the ampersand and the equals sign — and each of them carries a structural meaning. A space is not allowed anywhere in a URL. Neither is a quote, a hash inside a value, or the Chinese, Arabic or accented letters that appear in half the world's page titles.
Percent encoding solves that by replacing an unsafe character with a percent sign followed by its byte value in hexadecimal. A space becomes %20, an ampersand inside a value becomes %26, and a non-ASCII character becomes a short run of percent escapes describing its UTF-8 bytes. The receiving server reverses the process and gets the original text back.
The subtlety is what counts as unsafe. In a full URL, encoding the colon or the slash would destroy the address, because the browser would no longer know where the scheme and the path begin. Inside a single query value, though, those same characters are unsafe — a redirect target containing its own ?page=2 has to be escaped, or the outer URL will absorb it. That is exactly the difference between the two modes on this page, and picking the wrong one is the most common cause of a broken link that looks perfectly valid.
URL encoding FAQ
Whole URL or single value?
Use whole URL when the input is a complete address and its punctuation must stay meaningful. Use single value for a search term, a filename or a redirect target, where the colon and slash have to be escaped too.
Why does a space become %20 sometimes and a plus sign other times?
Both are accepted in different places. %20 is the true percent-encoded form of a space and is always correct; the plus sign is a form-and-query-string convention where a plus is read as a space.
Is the text I paste uploaded?
No. Encoding and decoding happen in your browser with JavaScript, and nothing is sent to a server.
Why does decoding throw an error?
A percent sign that is not followed by two valid hexadecimal digits is not valid percent encoding. That usually means the string was already decoded once, or a stray percent sign was typed by hand.
Related tools
- Base64 Encoder and Decoder — for values that cannot be expressed with percent escapes.
- JSON Formatter and Validator — format the response you just fetched.
- SHA Hash Generator — sign or checksum a payload.
- All developer tools — eight browser-based utilities.