Base64 Encoder / Decoder
Encode text to Base64 or decode Base64 back to text, with full UTF-8 support and a URL-safe Base64Url mode.
Input
Output
How to use the Base64 encoder and decoder
Paste text or a Base64 string, then choose encode or decode. The output updates as you type. Use the URL-safe variant when the result goes into a URL or a JWT: it swaps "+" and "/" for "-" and "_" and drops the trailing "=" padding. Everything runs in your browser.
Why Base64 matters
Base64 lets binary data travel through systems that only handle text, such as email, URLs, JSON, XML and environment variables. It shows up across modern APIs: JWTs are made of three Base64Url segments, HTTP Basic Auth headers look like Basic base64(user:pass), and data URIs such as data:image/png;base64,... embed images directly in HTML or CSS.
Common uses
- Decoding the payload of a JWT
- Creating data URIs to inline small images in CSS
- Encoding credentials for HTTP Basic Auth
- Preparing Base64 values for webhook payloads
- Decoding attachments found in raw email source
Standard Base64 vs URL-safe Base64Url
Standard Base64 uses A to Z, a to z, 0 to 9, "+", "/" and "=" padding. Base64Url, defined in RFC 4648, replaces "+" with "-" and "/" with "_", and usually drops the padding. JWTs and many web APIs use the URL-safe form, while older systems use standard. Check what your destination expects.
Frequently asked questions
Is Base64 encryption?
No. Base64 is an encoding and anyone can decode it. Never use it to hide sensitive data. Use real encryption such as AES for that.
Why is the output about 33% larger?
Base64 represents every 3 bytes as 4 text characters, so the size increase is built into the format. Compress the data first if size matters.
How is this different from the browser's btoa?
The built-in btoa only accepts Latin-1 characters and throws on emoji. This tool converts your text to UTF-8 bytes first, so accented letters, emoji and non-Latin scripts encode correctly.
Can I encode files?
This tool handles text only. For files, use a file-to-data-URI tool or run base64 in your terminal.

