Base64 and URL encoding & decoding in one place
Encode plain text to Base64 or decode Base64 back to plain text.
Encode special characters for use in URLs, or decode a percent-encoded string.
| Character | Encoded | Name |
|---|---|---|
| space | %20 | Space |
| & | %26 | Ampersand |
| = | %3D | Equals |
| + | %2B | Plus |
| / | %2F | Slash |
| ? | %3F | Question mark |
| # | %23 | Hash |
Base64 encodes binary data as ASCII text using 64 printable characters. Every 3 bytes of input produce 4 characters of output, so encoded strings are ~33% larger.
encodeURIComponent encodes nearly all special characters — use it for query string values. encodeURI preserves URL structure characters like / ? # & — use it for full URLs.