Base64

DEVELOPMENT

Quick Definition

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is used to safely transmit binary content like images, files, and cryptographic keys over channels designed for text, such as email (MIME), JSON payloads, URLs, and HTML data attributes.

How it works

Base64 takes every 3 bytes (24 bits) of input and splits them into four 6-bit groups. Each 6-bit value maps to one of 64 characters in the Base64 alphabet. If the input length is not a multiple of 3, the output is padded with = signs. This process increases the data size by approximately 33%, which is the tradeoff for safe text transmission.

Base64 is encoding, not encryption. Anyone can decode a Base64 string back to its original form instantly. It provides no security whatsoever. Its purpose is format compatibility, not confidentiality. A common mistake is Base64-encoding sensitive data (like API keys) and assuming it is hidden.

Why it matters

Base64 appears constantly in web development. Data URIs embed images directly in HTML and CSS using Base64. JSON Web Tokens encode their header and payload as Base64url (a URL-safe variant). Email attachments are Base64-encoded for MIME transport. Understanding Base64 helps developers debug encoded payloads, reduce unnecessary API calls for small assets, and recognize when data is encoded versus encrypted.

Where you'll see this on TerminalFeed

TerminalFeed provides a Base64 Encode/Decode tool that converts text and files to and from Base64 instantly in the browser. The JWT Decoder also decodes Base64url-encoded token segments.