Base64 Encode / Decode
Quickly find your Base64 conversion with our free Base64 Encode Decode. Simple, fast, and accurate.
Input
Output
What is a Base64 Encode / Decode Calculator?
A Base64 Encode / Decode calculator converts text to Base64 format and decodes Base64 strings back to readable text. Base64 encodes binary data into ASCII using 64 characters (A-Z, a-z, 0-9, +, /), making it safe for transport over text-based protocols like email and JSON APIs. The tool handles the conversion instantly in your browser.
How to calculate Base64 encoding manually (the formula)
Base64 processes data in 3-byte (24-bit) groups. Each group is split into four 6-bit values, and each 6-bit value maps to one of 64 characters using the Base64 index table: A-Z (0-25), a-z (26-51), 0-9 (52-61), + (62), / (63). If the input length is not a multiple of 3, padding with = characters is added. For example, the text Man (3 bytes) becomes TWFu.
Example calculation
Take the string Hello. In ASCII: H=72, e=101, l=108, l=108, o=111. The 24-bit groups are (72,101,108) and (108,111) with 1 byte of padding. Group 1: 01001000 01100101 01101100 → 010010 (S=18), 000110 (G=6), 010101 (V=21), 101100 (s=44) → SGVs. Group 2: 01101100 01101111 + padding → 011011 (b=27), 000110 (G=6), 111100 (8=60), = = padding → bG8=. Final result: SGVsbG8=.
Common mistakes
- Treating Base64 as encryption — Base64 is not secure; anyone can decode it instantly. Never use it to protect sensitive data.
- Adding line breaks or whitespace — Base64 strings must be contiguous. Extra whitespace or newlines cause decoding errors.
- Missing padding — Some decoders are lenient, but strict Base64 requires correct = padding for inputs not divisible by 3.
Frequently asked questions
What is Base64 encoding?
Base64 converts binary data into ASCII text using 64 characters (A-Z, a-z, 0-9, +, /) for safe transmission.
How do I decode a Base64 string?
Use atob() in JavaScript or the built-in decode function to reverse the encoding process.
When should I use Base64?
For embedding images in HTML/CSS, email attachments (MIME), and storing binary data in JSON.
Is Base64 encryption?
No, Base64 is an encoding scheme, not encryption. It can be decoded easily without a key.
Does Base64 increase file size?
Yes, Base64 adds roughly 33% overhead because every 3 bytes become 4 characters.
What characters are used in Base64?
Uppercase A-Z, lowercase a-z, digits 0-9, plus (+) and forward slash (/), with equals (=) for padding.