Base64 Encoder and Decoder: Convert Text to Base64
Paste text to encode it to Base64, or paste a Base64 string to decode it back to the original text.
Base64 encoding and decoding: how it works, example, limits
Base64 represents bytes with 64 printable characters (A-Z, a-z, 0-9, + and /): every group of 3 bytes becomes 4 characters, which makes the data about a third larger, with one or two = signs as padding when needed. Hello is encoded as SGVsbG8=.
How it works
Bytes are read in 24-bit chunks split into four 6-bit blocks; each block, from 0 to 63, maps to one character of the alphabet A-Z, a-z, 0-9, + and /. When the last chunk is incomplete, one or two = signs pad the output. Encoded length = 4 × ceiling(number of bytes ÷ 3).
Example
Hello is 5 bytes: 4 × ceiling(5 ÷ 3) = 8 characters, SGVsbG8=, including one padding sign. In decode mode, Qm9uam91cg== shows Bonjour; the unpadded form SGVsbG8 is accepted too.
What the tool does
- Conversion runs on every keystroke, in your browser: nothing is sent to a server.
- The swap button exchanges both fields and the conversion direction, handy for checking a round trip.
- Text is encoded as UTF-8, as in most languages: Café gives Q2Fmw6k=, € gives 4oKs and emoji work too. When decoding, the base64url variant used in JWT tokens (- and _ instead of + and /, no =) is accepted and line breaks are ignored.
- Invalid input (a character outside the alphabet, an impossible length) shows an error message.
Limits
- Base64 produced as Latin-1 by another tool (6Q== for é) decodes with a replacement character (�) instead of the accented letter.
- Only text can be entered, not files or images.
Base64 is not encryption: anyone can decode an HTTP Basic credential such as dXNlcjptb3RkZXBhc3Nl (user:motdepasse) in one click.
Sources and dates: alphabet and padding defined by IETF RFC 4648 (October 2006); btoa and atob functions specified by the WHATWG HTML Standard (checked 14/10/2026).
Frequently Asked Questions
Why does a base64 string end with = or ==?
Base64 encodes bytes in groups of 3. If 1 byte is left at the end, the output ends with ==; if 2 are left, with a single =. Hello (5 bytes) gives SGVsbG8=, while a 6-byte text has no padding at all.
How much larger does base64 make data?
About a third: 3 bytes become 4 characters, i.e. 4 × ceiling(bytes ÷ 3). A 3 MB file therefore takes about 4 MB once encoded, slightly more if the encoder inserts line breaks.
How does the tool encode accented letters and the € sign?
As UTF-8, like most languages and tools: é gives w6k=, € gives 4oKs, and emoji work too. Base64 produced as Latin-1 (6Q== for é) decodes with a replacement character (�): re-encode the source as UTF-8.
Does base64 protect a password?
No, it is a reversible encoding with no key. dXNlcjptb3RkZXBhc3Nl decodes straight to user:motdepasse, which is why HTTP Basic authentication should only travel over HTTPS.
Is this tool really free?
Yes, all tools on Kristools are 100% free and accessible without registration.
Is my data protected?
Yes. All processing is performed directly and securely inside your browser. No personal data is sent to our servers.