URL Encoder / Decoder
Encode or decode URL strings with percent-encoding
About this calculator
Choose between encodeURIComponent (for query values) and encodeURI (for whole URLs), then encode or decode with one click.
The mode switch matters: the wrong choice breaks query strings or double-encodes a whole address.
How to use it
- Choose the Mode.
- Paste the input and press Encode → or ← Decode.
- Press Copy.
Percent-encoding
URLs can contain only certain characters. Others are replaced with % and two hex digits of the UTF-8 byte: a space is %20, & is %26, / is %2F and é is %C3%A9. encodeURIComponent encodes everything except letters, digits and - _ . ! ~ * ' ( ), which is right for a query value. encodeURI leaves URL structure characters (: / ? # & =) alone, which is right for a whole address.
Worked example
Example
| hello world & more | hello%20world%20%26%20more |
| https://a.com/?q=café | https://a.com/?q=caf%C3%A9 (full URL mode) |
Runs entirely in your browser. Nothing you paste is uploaded.
Tips and common mistakes
- Encode query values, not the whole URL, with encodeURIComponent.
- A plus sign means space only in form data (query strings); use %20 elsewhere.
- Don't encode twice. %2520 means a literal %20.
- Non-English characters are encoded as UTF-8 bytes.
- If a link is broken by a special character, encode that part.
Frequently asked questions
What is URL encoding?
Replacing unsafe characters with % and two hex digits.
What is %20?
A space.
What is the difference between encodeURI and encodeURIComponent?
encodeURI keeps URL structure characters; encodeURIComponent encodes them.
Why do I see %2520?
The URL was encoded twice.
Does + mean space?
Only in query strings from HTML forms.
How do I decode a URL?
Press Decode.