Base64 Encoder / Decoder

Developer

Encode text to Base64 or decode Base64 strings instantly. Essential tool for data encoding in APIs and web development.

0 chars

What is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /). It converts every 3 bytes of input into 4 ASCII characters, making binary data safe for transmission over text-based protocols like email (MIME), HTTP headers, and JSON payloads.

Base64 encoding increases data size by approximately 33%, but ensures data integrity when transferred through systems that only support ASCII text. This tool encodes and decodes Base64 strings entirely in your browser — no data is sent to any server.

Common Uses for Base64 Encoding

Data URIs in HTML/CSS

Embed images, fonts, and small files directly in HTML or CSS using data:image/png;base64,... format to reduce HTTP requests and improve page load performance.

JWT Tokens

JSON Web Tokens use Base64url encoding for the header and payload sections. Decoding a JWT reveals the claims and metadata stored inside the token.

Email Attachments (MIME)

SMTP email protocols use Base64 to encode binary file attachments, allowing documents, images, and archives to be sent as plain text within email messages.

API Authentication

HTTP Basic Authentication encodes username:password pairs in Base64 for the Authorization header. Many API keys and tokens are also Base64-encoded.

Frequently Asked Questions

Is Base64 encryption?

No. Base64 is an encoding scheme, not encryption. Anyone can decode Base64 data without a key. Never use Base64 alone to protect sensitive information — it provides obfuscation, not security.

What is the difference between Base64 and Base64url?

Base64url replaces + with - and / with _, and omits padding (=). It is URL-safe and used in JWTs, OAuth tokens, and URL parameters where standard Base64 characters would need percent-encoding.

Why does Base64 encoded data end with = or ==?

The = characters are padding to ensure the encoded output length is a multiple of 4. One = means 2 bytes of input in the final group; == means 1 byte. Some implementations omit padding.

What is This Tool?

A Base64 encoder/decoder converts text and binary data to and from Base64 encoding. Base64 is a binary-to-text encoding scheme that represents binary data using 64 ASCII characters (A-Z, a-z, 0-9, +, /), making it safe for transmission through text-based protocols like email, JSON, and HTML.

Base64 increases data size by approximately 33% (every 3 bytes become 4 characters). Despite the overhead, it is essential for embedding binary data in text formats — data URIs in HTML/CSS, email attachments (MIME), JWT payloads, API request bodies, and configuration files.

Common Use Cases

API Development

Encode/decode Base64 payloads for REST APIs, webhook signatures, and authentication headers (Basic Auth).

Email & MIME

Debug Base64-encoded email attachments, S/MIME signatures, and MIME multipart message bodies.

Data URI Creation

Convert small images, fonts, and files to Base64 data URIs for inline embedding in HTML and CSS.

JWT Debugging

Decode Base64url-encoded JWT header and payload sections to inspect claims and token structure.

Frequently Asked Questions

What is the difference between Base64 and Base64url?

Base64url replaces + with - and / with _, and removes padding (=). It is safe for URLs, filenames, and JWT tokens.

Does Base64 provide encryption?

No. Base64 is an encoding, not encryption. It is trivially reversible and provides zero security. Never use it to "hide" sensitive data.

Why does Base64 make data larger?

Every 3 input bytes produce 4 output characters (33% increase), plus optional padding. This is the cost of representing binary data in a text-safe format.