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.
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.
๐ผ๏ธ 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 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.
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.
Tyagi