Skip to main content
Utilities Tool

Base64 Encoder & Decoder

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters. It is widely used to embed images in HTML or CSS, transmit data over email (MIME), store binary content in JSON, and pass data through APIs that only accept text. This tool lets you encode any text โ€” including Unicode, emoji, and multiline content โ€” to Base64, and decode Base64 strings back to their original form, entirely inside your browser with no data sent to any server.

Select a Mode
0 chars ยท 0 bytes
0 chars
0 chars
0 chars
โš ๏ธ Base64 is NOT Encryption Base64 is a plain encoding scheme โ€” it is completely reversible and offers zero security. Anyone who receives a Base64 string can decode it instantly. Never use Base64 to protect passwords, API secrets, personal information, or any sensitive data. For secure storage of passwords use bcrypt or Argon2; for encrypting data use AES or RSA. Base64 should only be used to safely transport binary data across text-based systems.
What is Base64 & How Does It Work?

Base64 is a binary-to-text encoding scheme defined in RFC 4648. It works by taking 3 bytes of binary data at a time (24 bits) and splitting them into 4 groups of 6 bits each. Each 6-bit group maps to one of 64 printable ASCII characters: Aโ€“Z, aโ€“z, 0โ€“9, +, and /. The = character is used as padding when the input length is not a multiple of 3. The result is always about 33% larger than the original binary data.

For Unicode text (like emoji or non-Latin scripts), the text is first converted to its UTF-8 byte sequence, and those bytes are then Base64-encoded. This is why this tool handles all languages correctly โ€” it encodes the underlying bytes, not raw character codes.

๐ŸŒ Real-World Use Cases

๐Ÿ–ผ๏ธ Embedding Images

Images can be embedded directly in HTML or CSS as data:image/png;base64,... URIs, eliminating the need for a separate network request. Used in email templates, SVG files, and inline HTML.

๐Ÿ“ง Email (MIME)

The MIME standard uses Base64 to encode binary email attachments โ€” images, PDFs, and documents โ€” so they can be safely transmitted over protocols that only handle 7-bit ASCII text.

๐Ÿ”‘ API Authentication

HTTP Basic Auth sends credentials as Authorization: Basic <base64(user:password)>. JSON Web Tokens (JWTs) also use URL-safe Base64 to encode their header and payload sections.

๐Ÿ“ฆ JSON & APIs

When a REST or GraphQL API needs to return binary data โ€” such as a file, a certificate, or a generated image โ€” it encodes it as a Base64 string so it fits cleanly inside a JSON field.

๐Ÿ—„๏ธ Data URIs

Fonts, audio clips, and small binary files can be inlined into web pages using Base64 data URIs, useful for single-file HTML exports, offline apps, and email-safe HTML.

๐Ÿ” Cryptographic Keys

PEM-format TLS certificates and SSH public keys are stored as Base64-encoded blocks between -----BEGIN----- and -----END----- headers โ€” a standard you see every day in HTTPS.

โš–๏ธ Encoding vs Encryption โ€” Key Difference

Encoding transforms data into a different format for compatibility โ€” it is public, standardized, and fully reversible without any key. Encryption scrambles data so that only someone with the correct secret key can read it. Base64 is encoding, not encryption. The two are fundamentally different: encoding is about format, encryption is about secrecy.

๐Ÿงฎ Size Impact

Every 3 bytes of input produce 4 Base64 characters โ€” a size increase of approximately 33%. For example, a 1 MB image becomes roughly 1.37 MB when Base64-encoded. Padding characters (=) are added to make the output length a multiple of 4. This overhead is worth it in contexts where binary data cannot be transmitted directly, but should be considered when embedding large assets inline.

๐Ÿ”’ Fully Browser-Based Processing This tool runs entirely inside your browser using the Web Crypto API and native JavaScript. Your text and Base64 data are never transmitted to any server, stored in a database, or logged anywhere. You can verify this by opening your browser's network inspector โ€” no outbound requests are made when you encode or decode.