Decode a Base64 image

rebuilds your image from its Base64 representation, useful when you need to extract assets out of a HTML or CSS Data URI

Why decode base64 images?

Decoding base64-encoded images is useful for extracting images from their base64 text representation. This may be necessary to view or manipulate images encoded this way, for example in web development to display images embedded directly in HTML or CSS code.

Features of the base64 decoding tool

This tool allows you to paste a base64 string representing an image and convert it into a standard image format such as JPEG, PNG, GIF, or other supported formats.

How to use the decoding tool

On the decoding page, you can paste the base64 string into the dedicated text area. Click the decode button to convert the base64 string into a visible image in the result area.

Once the image is decoded, it will be displayed in a result area. You can download the decoded image or copy the HTML or CSS code needed to integrate it into your projects.

Example of base64 image decoding

Here is an example of decoding a base64-encoded JPEG image:


<img src="data:image/jpeg;base64,/9j/4RiDRXhpZgAATU0AKgA..." alt="Decoded image">

    

Frequently asked questions

Should I paste the full Data URI or just the base64 part?

Both work. You can paste the full Data URI in the form data:image/png;base64,iVBORw0KGgo… or directly the raw base64 string that follows the comma. When the data: prefix is present, the MIME type is read from it to determine the generated file extension (PNG, JPG, SVG, WebP, GIF).

Is the image sent to a remote server?

Decoding is performed on our server only for the duration of the request, then the result is sent back. No image is kept after processing, and no call is made to a third-party service. For very sensitive content, prefer local decoding with base64 -d on the command line.

Why does my decoding produce an unreadable file?

The most common cause is a truncated string during copy-paste, especially from a terminal that cuts long lines. Check that the string ends correctly with one or two = and that no line break has been inserted in the middle. A valid base64 string only contains the characters A-Z, a-z, 0-9, +, / and =.

Which image formats are recognised in output?

The decoder recognises standard web formats: PNG, JPEG, GIF, WebP, SVG and BMP. The MIME type present in the Data URI is used to pick the downloaded file extension. If the base64 string is provided without a data: prefix, a generic extension is used and you can correct it manually before saving.

Is there a size limit?

The accepted size depends on our server's form submission limit, set to a few megabytes. As a reminder, a base64 image is about 33% larger than its binary equivalent. Beyond a few hundred KB, it becomes more practical to manipulate the file directly rather than using a base64 representation.

How to do the reverse operation?

To transform an image into base64, use our base64 image encoder. You upload your file and get a Data URI ready to paste into HTML, CSS or JSON. The round trip is lossless: base64 encoding is a byte-for-byte bijection.

Example request

curl -X POST https://cdrn.fr/api/v1/tools/base64-image-decoder/execute \
  -H "Content-Type: application/json" \
  -d '{"text_encoded":"..."}'

Input schema

Field Type Required Default
text_encoded text

Endpoints

  • GET https://cdrn.fr/api/v1/tools - lists every available tool
  • GET https://cdrn.fr/api/v1/tools/base64-image-decoder - returns the schema for this tool
  • POST https://cdrn.fr/api/v1/tools/base64-image-decoder/execute - runs this tool with a JSON payload