What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data as a sequence of printable ASCII characters. It encodes every three bytes of input into four characters drawn from a 64-character alphabet (A–Z, a–z, 0–9, +, /), expanding the size by approximately 33% but ensuring safe transmission through text-only channels.

Base64 is ubiquitous in computing because many protocols — email (MIME), HTTP, and JSON — were designed around text and cannot carry raw binary safely. By encoding binary data into a stable set of 64 printable characters, Base64 makes it possible to embed images in HTML, transmit cryptographic keys in JSON, and store binary blobs in databases that only accept text.

The encoding process splits input bytes into 6-bit groups (since 2^6 = 64) and maps each to a character in the Base64 alphabet. If the input length is not a multiple of three, padding characters (=) are appended to make the output a multiple of four characters long. A variant called Base64url replaces + with - and / with _ to make the output safe inside URLs and filenames — this is the variant used in JWTs.

Decoding reverses the process: each character is looked up in the alphabet table, the resulting 6-bit values are concatenated, and the bytes are reconstructed. Base64 is not encryption — anyone with the encoded string can decode it trivially. Its only purpose is encoding, not security.

Common uses include: embedding binary file attachments in email (MIME), storing images directly in HTML or CSS as data URIs, encoding cryptographic keys and certificates in PEM format, and transmitting binary API payloads through JSON.

quickhelp.dev's Base64 tool encodes and decodes strings and binary files instantly in the browser — no server-side processing, no data leaving your device.

See also

We use cookies to serve ads and measure traffic. Cookie policy · Privacy policy