Base64 is a way to represent binary data using only printable text characters. It is used everywhere in web development — from HTTP auth headers to email attachments to JWT tokens.
What Base64 is
Base64 is an encoding scheme that converts binary data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It uses = as padding.
The name "Base64" refers to the fact that it uses 64 distinct characters to represent data. Each Base64 character encodes 6 bits of binary data. Three bytes (24 bits) of input produce four Base64 characters.
Why Base64 exists
Many systems were designed to handle text, not arbitrary binary data. Email systems, HTTP headers, XML, JSON, and URLs all have characters that have special meaning. If you try to put raw binary data (like an image or a compressed file) into these systems, the special characters in the binary data break the format.
Base64 solves this by encoding binary data into a safe subset of printable characters that travel through these systems without being modified.
Where you see Base64
Base64 appears in many places:
• HTTP Basic Auth: credentials are encoded as Base64 in the Authorization header ("Authorization: Basic dXNlcjpwYXNz")
• JWT tokens: the header and payload sections of a JWT are Base64url-encoded
• Email attachments: MIME encodes binary attachments as Base64 for transmission
• Data URIs: images and fonts can be embedded inline in HTML/CSS as data:image/png;base64,...
• API payloads: binary data (like file content) sent in JSON is often Base64-encoded
How to encode and decode Base64
Use the FormatGenie Base64 Encoder to encode text or binary data to Base64, and the Base64 Decoder to reverse it. Both tools run in your browser — your data is never uploaded.