Base64 Encode and Decode
Convert text or a file to Base64 and back, with UTF-8 handled correctly.
59 bytes
Base64
80 bytes · 136% of the original
How it works
- 1Paste text to encode it, or paste Base64 to decode it back. The conversion happens as you type.
- 2Text is converted to UTF-8 bytes first, which is what makes accented characters and emoji survive the round trip.
- 3Use "Encode a file" for binary — an image, a PDF, a certificate. The result is the Base64 of the raw bytes.
- 4Decoding accepts either variant, with or without padding, and ignores line breaks pasted in from an email.
Common questions
- Why does my text with accents or emoji break in other converters?
- Because they call btoa() directly, which only handles characters up to code point 255 and throws on anything else. This tool converts to UTF-8 bytes first, so "café" and "🎯" encode and decode correctly.
- What is the difference between standard and URL-safe Base64?
- Standard uses + and / and pads with =, all three of which have meaning inside a URL. The URL-safe variant swaps them for - and _ and drops the padding. Decoding here accepts both without being told which.
- Is Base64 encryption?
- No, and this matters. It is an encoding — anyone can reverse it instantly, as this page demonstrates. It exists to carry binary data through channels that only handle text, not to hide anything. Never use it to protect a secret.
- Why did my file get bigger?
- Base64 represents every 3 bytes as 4 characters, so the output is about 33% larger. That is inherent to the format, not something a better encoder would avoid.
- Is my data uploaded?
- No. Everything runs in your browser, including the file encoding. Nothing is sent to a server, which matters when the thing you are encoding is a private key or a certificate.
Need a checksum rather than an encoding?
The Hash Generator produces SHA-256 and friends for the same text or file — the right tool when you want to verify something has not changed, rather than transport it.
Open the Hash GeneratorRelated tools
URL Encoder and Decoder
Percent-encode a URL or a single query value, with the component and full-URI rules kept apart.
Hash Generator
SHA-1, SHA-256, SHA-384 and SHA-512 for text or a file, computed in your browser.
Gzip Compress and Decompress
Compress text or a file with gzip or deflate and see exactly how much smaller it got.