Free Online Tool · No signup
URL Encoder & Decoder
Percent-encode special characters in URLs, or decode them back — instantly. Switch between component encoding, full URL encoding, and decoding without losing your work.
Raw Text / Value
Encoded Output
0 chars
Invalid percent-encoded input — check your string and try Decode again.
What is URL Encoding?
Percent-encoding converts unsafe characters into a %XX hex format safe for URLs. A space → %20, & → %26. Required for URLs to work across all browsers and servers.
Component vs Full URL
Component (encodeURIComponent) encodes everything including / ? & — use for query values. Full URL (encodeURI) preserves structural characters.
Fully Private
All encoding runs in your browser via JavaScript. Your input never leaves your device, works offline, and is safe for sensitive query strings and tokens.
Common Percent-Encoding Reference
| Char | Name | Encoded | Notes |
|---|---|---|---|
| Space | Space | %20 | Also written as + in form data |
| ! | Exclamation mark | %21 | Encoded by encodeURIComponent |
| # | Hash / Number sign | %23 | Separates URL from fragment |
| & | Ampersand | %26 | Separates query parameters |
| ' | Apostrophe | %27 | |
| + | Plus sign | %2B | Decoded as space in form data |
| / | Slash | %2F | Path separator — preserved by encodeURI |
| : | Colon | %3A | Separates scheme from host |
| = | Equals sign | %3D | Separates key from value in query |
| ? | Question mark | %3F | Starts the query string |
| @ | At sign | %40 | Separates userinfo from host |
| [ | Left bracket | %5B | |
| ] | Right bracket | %5D |
Frequently Asked Questions
What is the difference between encodeURI and encodeURIComponent?
encodeURI() is for encoding a complete URL — it preserves : / ? & = # because these have structural meaning. encodeURIComponent() encodes everything except letters, digits, and -_.!~*'() — use it for individual query parameter values, not full URLs.
What is the difference between %20 and + for spaces?
%20 is the universal percent-encoding for a space. The + sign represents a space only in application/x-www-form-urlencoded data (HTML form submissions). In a URL path or most other contexts, + is a literal plus sign. When in doubt, use %20.
Why do URLs need encoding at all?
URLs can only contain a defined set of ASCII characters. Spaces, accented letters, symbols, CJK scripts, and reserved characters like
& or = must be encoded so the URL remains unambiguous across all browsers, servers, and operating systems worldwide.
Can I URL-encode non-English characters (Unicode)?
Yes. Unicode characters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example あ (U+3042) becomes
%E3%81%82. This tool handles Unicode correctly via JavaScript's built-in encodeURIComponent.
Which characters are safe in a URL without encoding?
Unreserved characters are always safe without encoding:
A–Z, a–z, 0–9, hyphen -, period ., underscore _, and tilde ~. Everything else — including spaces, brackets, slashes, and any non-ASCII character — should be encoded.
How do I handle a double-encoded URL?
Double-encoding happens when a URL is encoded twice — a space becomes
%20, then %2520. To fix it, decode twice: first pass turns %2520 → %20, second pass turns %20 → space. Just click Decode, then paste the output back and decode again.