All tools

Base64 Encoder / Decoder

Encoding

Encode & decode Base64 for text and files, with live image preview.

Base64 Encoder / Decoder

two-way live

About the Base64 Encoder / Decoder

Base64 is a binary-to-text encoding scheme that represents arbitrary bytes as an ASCII string using 64 printable characters. It is essential whenever binary data must travel through a text-only channel — HTTP headers, JSON payloads, email attachments, or inline images in CSS.

How Base64 encoding works

Base64 groups the input bytes into 6-bit chunks and maps each chunk to a character in the set [A-Za-z0-9+/]. Because 3 input bytes become 4 output characters, encoded data is roughly 33% larger than the source. Padding characters ('=') are appended when the input length is not a multiple of three.

The scheme is not encryption. Base64 is entirely reversible without a key, so never use it to protect secrets. Its purpose is transport safety, not confidentiality.

Common use cases

Embedding small images or fonts directly inside HTML, CSS, or SVG using the data:URI scheme eliminates an extra HTTP request. This is useful for icons, tracking pixels, or above-the-fold hero art that must render before any network round-trip.

APIs frequently use Base64 to send binary payloads in JSON, including file uploads, PDF signatures, and cryptographic keys. Basic HTTP authentication also encodes credentials as Base64.

Performance considerations

Base64 makes payloads larger and requires CPU cycles to decode. For files above a few kilobytes, a normal binary transfer is faster. Modern browsers handle inline data URIs well, but very large embedded images bloat HTML and slow down parsing.

When encoding for the web, remember that Base64 strings do not compress well with gzip because their alphabet is already dense. Prefer real binary uploads for anything larger than 4–8 KB.

Step-by-step usage

For text: type or paste into the plain-text panel and read the Base64 immediately in the right panel — or paste Base64 on the right to decode into readable text on the left. Invalid Base64 is flagged inline.

For files: switch to File mode and drop an image, PDF, or text file (up to 5 MB). The tool produces a full data:URI string ready to paste into HTML, CSS, or a JSON payload. Images render a live preview so you can confirm the encoding is intact.

Frequently Asked Questions

No. Base64 is an encoding, not encryption. Anyone can decode it with a browser or one-line script. Use TLS, AES, or another encryption algorithm for actual security.