Skip to content
DevToolsCave
    Encoding & Decoding

    Base64 Encoder/Decoder

    Encode text to base64, or decode base64 back to text. Both fields stay in sync as you type — entirely in your browser.

    How base64 encoding works

    Base64 splits input bytes into 6-bit groups and maps each group to one of 64 printable characters. Because 6 doesn't divide evenly into 8 (a byte), the output is roughly 33% larger than the input, and short inputs are padded with = so the length is a multiple of 4.

    Common use cases

    • Embedding small images or files as data URIs in CSS/HTML
    • Encoding binary data (like credentials) for HTTP headers, e.g. Basic Auth
    • Passing structured data through systems that only accept plain text

    Frequently asked questions

    What is base64 encoding?
    Base64 represents binary or text data using only 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It's commonly used to safely embed data in places that only support text, like JSON payloads, URLs, or email attachments.
    Is base64 the same as encryption?
    No — base64 is an encoding, not encryption. It provides no confidentiality; anyone can decode it instantly, as this tool demonstrates. Never use base64 alone to protect sensitive data.
    Why did decoding fail on my input?
    Either the text contains characters outside the base64 alphabet (A–Z, a–z, 0–9, +, /, and = padding), the length/padding is invalid, or the decoded bytes aren't valid UTF-8 text (e.g. you pasted base64 of an image or other binary file).
    Does this handle Unicode text correctly?
    Yes — encoding and decoding both go through UTF-8, so emoji, accented characters, and non-Latin scripts round-trip correctly.