{"inline_business":{"base64-converter":{"error_invalid_input":"Error: Invalid Input","text_label":"Text","switch_label":"Switch"}},"docs_business":{"tools":{"base64":{"content":{"title":"Base64 encoding and decoding: how it works, example, limits","intro":"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=.","details":"

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

Limits

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).

"},"faqs":[{"question":"Why does a base64 string end with = or ==?","answer":"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."},{"question":"How much larger does base64 make data?","answer":"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."},{"question":"How does the tool encode accented letters and the € sign?","answer":"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."},{"question":"Does base64 protect a password?","answer":"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."}]}}}}