0 characters
0 characters
Copied ✓
Drop a file here or click to choose
Max 5 MB — any file type
Advanced options

How does Base64 encoding work?

Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters. It uses an alphabet of 64 characters: the letters A–Z and a–z, the digits 0–9, and + and / (or - and _ in the URL-safe variant).

The algorithm divides data into groups of 3 bytes (24 bits), then converts them into 4 characters of 6 bits each. If the number of bytes is not divisible by 3, the = character is used as padding at the end.

Important: Base64 is an encoding, not encryption. Encoded data can be decoded by anyone without a secret key. Never use Base64 to secure sensitive data.

Why use Base64?

Base64 encoding allows binary data (images, files, tokens) to be transmitted through systems that only handle ASCII text, such as emails (MIME), URLs, or JSON APIs.

Common use cases

🖼️

Images in CSS / HTML

Embed images directly in your code via data:image/png;base64,… to avoid HTTP requests.

🔑

JWT Tokens

JSON Web Tokens use URL-safe Base64 to encode their header and payload. Decode them to read the content.

📡

APIs & JSON

Transmit binary data (PDFs, images) in JSON APIs without special character issues.

📧

MIME Emails

Email attachments are encoded in Base64 (RFC 2045) with line breaks every 76 characters.