Base64 Encoder & Decoder

Encode text to Base64, decode Base64 to text, or convert files and images to Base64 data URIs. Instant, private, client-side.

100% Client-Side — Your Data Never Leaves Your Browser
Input0 B
Output0 B
Ratio-
EncodingUTF-8
Click or drop a file to convert to Base64
Preview
File-
Type-
Size-
Base64 Size-

Quick Examples

👋
Hello World
Basic text encoding
{}
JSON Payload
API request body
🌍
Unicode Text
Multi-language encoding
🔑
JWT Token
Decode a JWT payload

Features

🔄

Encode & Decode

Convert text to Base64 and back. Full UTF-8 support including emoji and CJK characters.

🖼️

File & Image Support

Drop any file to get its Base64 data URI. Preview images directly in the browser.

🔗

URL-Safe Mode

Generate URL-safe Base64 (RFC 4648 §5). Replaces + with - and / with _. No padding.

📈

Size Analysis

See input/output byte sizes and the encoding ratio. Base64 adds ~33% overhead.

🔒

100% Private

Everything runs in your browser. No data is ever sent to any server.

Instant Results

Real-time encoding and decoding as you type or paste. No button clicks needed.

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters. It's used extensively in web development for embedding images in CSS/HTML, encoding API authentication tokens (like JWTs), transmitting binary data in JSON, and email attachments (MIME).

The encoding works by taking 3 bytes of binary data and converting them to 4 ASCII characters from the set A-Z, a-z, 0-9, +, and /. This means Base64-encoded data is always ~33% larger than the original.

JavaScript Examples

// Encode text to Base64 const encoded = btoa('Hello, World!'); // "SGVsbG8sIFdvcmxkIQ==" // Decode Base64 to text const decoded = atob('SGVsbG8sIFdvcmxkIQ=='); // "Hello, World!" // Encode with UTF-8 support const utf8 = btoa(unescape(encodeURIComponent('Hello 👋'))); // File to Base64 data URI const reader = new FileReader(); reader.readAsDataURL(file); reader.onload = () => console.log(reader.result);

Need Base64 in your API workflow?

Clawdia Agent Gateway provides 40+ APIs including screenshot capture (returns Base64), file storage, and code execution. All with a free tier.

Explore the API →

FAQ

Is this Base64 tool free?
Yes, completely free with no limits. No signup, no ads, no data collection. It runs entirely in your browser using JavaScript.
Is my data safe?
Your data never leaves your browser. All encoding and decoding happens client-side. No server requests are made. Verify in your browser's Network tab.
What's the difference between standard and URL-safe Base64?
Standard Base64 (RFC 4648 §4) uses A-Z, a-z, 0-9, +, / with = padding. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and omits padding. Use URL-safe when the encoded string will appear in URLs or filenames.
Does it support Unicode / emoji?
Yes. The tool handles full UTF-8 encoding, including emoji, CJK characters, and other multi-byte characters. It uses TextEncoder/TextDecoder for proper Unicode support.
How much larger is Base64 than the original?
Base64 encoding adds approximately 33% overhead. Every 3 bytes of input becomes 4 bytes of output. For example, a 75 KB image becomes ~100 KB when Base64-encoded.