Encode text to Base64, decode Base64 to text, or convert files and images to Base64 data URIs. Instant, private, client-side.
Convert text to Base64 and back. Full UTF-8 support including emoji and CJK characters.
Drop any file to get its Base64 data URI. Preview images directly in the browser.
Generate URL-safe Base64 (RFC 4648 §5). Replaces + with - and / with _. No padding.
See input/output byte sizes and the encoding ratio. Base64 adds ~33% overhead.
Everything runs in your browser. No data is ever sent to any server.
Real-time encoding and decoding as you type or paste. No button clicks needed.
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.
// 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);Clawdia Agent Gateway provides 40+ APIs including screenshot capture (returns Base64), file storage, and code execution. All with a free tier.
Explore the API →