{
    "@context": "https://schema.org",
    "@type": "NewsArticle",
    "@id": "https://badiyaa.com/base64-encoding-how-it-works/#article",
    "mainEntityOfPage": "https://badiyaa.com/base64-encoding-how-it-works/",
    "headline": "Base64 explained: how 64 characters let email and web pages carry images, keys and other binary data",
    "description": "Base64 turns every three bytes of a file into four printable characters, which is how email attachments and embedded web images travel as text.",
    "datePublished": "2026-11-18T18:15:00+00:00",
    "dateModified": "2026-11-18T18:15:00+00:00",
    "author": {
        "@type": "Organization",
        "name": "Badiyaa Editorial Desk",
        "url": "https://badiyaa.com/author/editorial-desk/"
    },
    "publisher": {
        "@type": "NewsMediaOrganization",
        "@id": "https://badiyaa.com/#organization",
        "name": "Badiyaa",
        "url": "https://badiyaa.com/",
        "logo": {
            "@type": "ImageObject",
            "url": "https://badiyaa.com/wp-content/uploads/2026/10/badiyaa-logo-color-600x60-1.png",
            "width": 600,
            "height": 60
        },
        "email": "badiyaavideo@gmail.com",
        "publishingPrinciples": "https://badiyaa.com/editorial-policy/",
        "correctionsPolicy": "https://badiyaa.com/corrections/",
        "actionableFeedbackPolicy": "https://badiyaa.com/contact/",
        "ownershipFundingInfo": "https://badiyaa.com/about/#ownership",
        "sameAs": [
            "https://www.facebook.com/profile.php?id=61595518283625",
            "https://www.instagram.com/badiyaa.com.ai/",
            "https://www.threads.net/@badiyaa.com.ai"
        ],
        "parentOrganization": {
            "@type": "Organization",
            "name": "Rezilient Digital",
            "url": "https://www.rezilientdigital.com/",
            "address": {
                "@type": "PostalAddress",
                "streetAddress": "Fl No 3, Nav Shyam Sadan, Plot No 38, Pestom Sagar, Chembur",
                "addressLocality": "Mumbai",
                "addressRegion": "Maharashtra",
                "postalCode": "400089",
                "addressCountry": "IN"
            },
            "sameAs": [
                "https://www.linkedin.com/company/rezilientdigital"
            ]
        }
    },
    "isAccessibleForFree": true,
    "inLanguage": "en-US",
    "wordCount": 538,
    "image": [
        "https://badiyaa.com/wp-content/uploads/2026/11/colorful-lines-of-code-unsplash-scaled.webp",
        "https://badiyaa.com/wp-content/uploads/2026/11/colorful-lines-of-code-unsplash-1024x684.webp"
    ],
    "articleSection": "Tech",
    "keywords": "ASCII, Base64, MIME, RFC 4648",
    "articleBody": "Base64 is one of the quiet workhorses of the internet: a way of writing any file, from a photo to an encryption key, using only 64 ordinary printable characters. It is why an email attachment survives the trip through old mail servers, and why a web page can carry a small image inside its own code instead of loading it separately. This explainer, based on the RFC 4648 standard and standard reference material on the encoding, walks through how the trick works and where it turns up. The problem it solves Computers store everything as bytes, and a byte can take any of 256 values. Many older text systems, especially email as first designed, were built to move only 7-bit ASCII text safely. Raw binary data sent through them could be mangled. Base64 sidesteps that by mapping data onto characters that almost every system treats as plain text: the capital letters A to Z, the lowercase letters a to z, the digits 0 to 9, and two extra symbols, usually + and /. The equals sign is kept for padding. How the encoding works The method takes the input three bytes at a time. Three bytes are 24 bits, and 24 bits split neatly into four groups of six. Each six-bit group is a number from 0 to 63, and that number picks one character from the 64-character alphabet. So every three bytes in become four characters out. A classic worked example uses the word Man. The letters M, a and n have the byte values 77, 97 and 110. Laid end to end and cut into six-bit chunks, those give the numbers 19, 22, 5 and 46, which map to T, W, F and u. Man becomes TWFu. When the input does not divide evenly by three, the encoder fills the gap with zero bits and adds one or two = signs at the end, so the decoder knows how many bytes are real. A single leftover byte ends in ==, two leftover bytes in a single =. The cost: about a third bigger Turning three bytes into four characters means Base64 output is roughly 33 percent larger than the original. Email systems that also insert line breaks, as the MIME standard does every 76 characters, add a few percent more. That overhead is why Base64 is used for convenience and safety rather than for storage. Where you meet it Base64 appears in email attachments, in data URIs that embed images and fonts directly in HTML and CSS, in PEM files that hold security certificates, and in the browser&#8217;s own atob() and btoa() functions. A URL-safe variant swaps + and / for &#8211; and _ so encoded strings can sit inside web addresses without extra escaping. One important point for anyone handling passwords or tokens: Base64 is an encoding, not encryption. Anyone can reverse it in a second, with no key. Treating it as a lock is a common mistake, much like reusing weak passwords such as the one that still tops the list of the world&#8217;s most common passwords. For more on everyday logins and their pitfalls, see Badiyaa&#8217;s story on BugMeNot, the shared-login site that closed after more than two decades, and the rest of our Tech coverage. Further reading Wikipedia: Base64 Image: Ilya Pavlov, CC0 via Wikimedia Commons This article was produced with AI assistance and reviewed by our Editorial Desk. How we work.",
    "markdown": "https://badiyaa.com/base64-encoding-how-it-works.md"
}