Input

Output

What is Base64 Encoding?

Need to encode data to Base64? Type or paste text, or upload a file, and the Base64 appears on the right as you go. Base64 (RFC 4648) is a standard encoding scheme that represents binary data as ASCII text, making it safe to transmit over channels that only support text.

According to MDN Web Docs, Base64 encoding is essential for embedding binary data in JSON, XML, HTML, and URLs. Our encoder follows the RFC 4648 Base64 specification for standard and URL-safe encoding.

Text is turned into UTF-8 bytes before it is encoded, and that matters more than it sounds. btoa() on its own encodes é as 6Q==, its Latin-1 byte, and throws on an emoji. This page gives w6k=, the UTF-8 answer that a server, base64 -d or Python's b64decode expects.

How to Use the Base64 Encoder

There is no Encode button. Text turns into Base64 while you type, and a file is encoded as soon as you pick it.

1

Paste, Upload, or Load Sample

Type or paste text into Input. It becomes UTF-8 bytes first, so accented names and emoji encode the way a server expects. Upload reads any file up to 5 MB as raw bytes, which is how a PNG or a certificate gets into Base64. Sample fills the input with this subscriber record:

{"subscriberId":"SUB-12345","plan":"Premium","status":"active","dataUsage":1024}
2

View Encoded Output

The right Output panel shows the Base64 as you type or paste. Tick URL-safe above it for the Base64url alphabet (- and _, no = padding) that JWTs and query strings use.

3

Copy or Download

Copy grabs the Base64 string and Download saves it as base64-encoded.txt. One quirk: an uploaded file's Base64 replaces the output while the input pane keeps its old text, and typing there again swaps the output back to that text's encoding. The trash-can icon resets both sides.

When You'd Actually Use This

Embed Images in HTML/CSS

Convert small images to Data URIs for embedding directly in HTML, CSS, or JSON. Reduces HTTP requests.

API Development

Send binary data through JSON APIs that only accept text. Encode images, PDFs, or files for transmission via REST endpoints.

Email Attachments

MIME email uses Base64 for attachments. Encode files for email transmission or decode received email attachments.

Configuration Files

Embed certificates, keys, or binary data in YAML, TOML, or JSON configs. Kubernetes secrets often use Base64.

Common Questions

Is my data stored?

No. Text is encoded with TextEncoder and btoa() in this tab, and an uploaded file is read with FileReader, so nothing goes over the network.

What's the difference between standard and URL-safe Base64?

Standard Base64 uses + and / characters. URL-safe replaces these with - and _ to avoid issues in URLs.

Is there a size limit for files?

The limit depends on your browser's memory. Small files (under 5MB) encode with no noticeable wait. Very large files may cause performance issues.

Can I decode Base64 too?

Yes! Use our Base64 Decoder to convert Base64 back to text or binary files.

Why does my output have = at the end?

Those are padding characters per RFC 4648. Base64 uses them to ensure the encoded length is a multiple of 4.

Is Base64 encryption?

No. Base64 is encoding, not encryption. It transforms data to text format but provides no security. Anyone can decode Base64.

Other Base64 Tools You Might Need

Encoding is just one part of Base64 workflow. Here are related tools: