Base64 Image Converter

Encode an image to Base64, or decode a Base64 string back into an image — both directions, entirely in your browser.

Convert between image and Base64

Choose a direction below, then upload an image or paste a Base64 string.

Drag & drop an image here, or click to browse
Supports JPG, PNG, WEBP and GIF.

    Result

    Original size
    0 KB
    Encoded length
    0 characters
    Uploaded image preview
    Preview
    Your image and Base64 data are processed locally in this browser tab using the FileReader API. Nothing is uploaded to Calcooo or any server.

    Encoding an image

    1. Switch the direction dropdown to Image → Base64 (the default).
    2. Drag and drop an image into the box, or click to browse and select one.
    3. The data URI and Base64 string appear instantly, along with a preview and the encoded length.
    4. Use Copy Data URI or Copy Base64 only to copy the result you need.

    Decoding a Base64 string

    1. Switch the direction dropdown to Base64 → Image.
    2. Paste a full data URI, or a raw Base64 string plus the correct image type from the dropdown.
    3. Press Decode & Preview to render the image.
    4. Click Download image to save the decoded file.

    Frequently asked questions

    Is my image or Base64 string uploaded anywhere?

    No. Encoding and decoding happens locally in your browser using the FileReader API. Nothing is uploaded to a server.

    What is a Base64 image string used for?

    It lets you embed an image directly inside HTML, CSS or JSON without a separate file request. This is common in emails, icons and data URIs.

    What's the difference between the raw Base64 string and a data URI?

    A data URI adds a prefix like data:image/png;base64, before the Base64 string so browsers know how to render it directly. This tool shows both and lets you copy either.

    Can I decode Base64 that doesn't include the data:image/... prefix?

    Yes — if you paste a raw Base64 string without a prefix, select the correct image type from the dropdown so it can be decoded and previewed correctly.