APNG to Base64

Encode animated PNGs as Base64 without losing frames.

Drag & drop a file here, or click to browse

Drop an animated PNG (.apng or .png). Max 10 MB, converted in your browser.

APNG to Base64 Converter

Encode an animated PNG (APNG) as Base64 and get a data URI that keeps every frame playing. Drop a .apng or animated .png file above to see the animation in the preview, then copy the data URI, HTML tag, CSS rule, or JSON object.

What is APNG?

APNG was proposed by Mozilla developers in 2004 as an extension to PNG. It adds three chunk types — acTL (animation control with frame count and loop count), fcTL (frame control with size, offset, delay, and blend mode), and fdAT (frame data). The first frame is stored as ordinary PNG image data, which is why an APNG opens as a still image in software that doesn't know about animation. Firefox supported it from 2008, Safari from 2014, and Chrome and Edge since 2017, so today it works in all major browsers. It offers true-color frames with full alpha transparency, lossless compression, and no patent issues.

APNG vs PNG MIME types

APNG has its own registered MIME type, image/apng, but the files usually keep the .png extension and many systems report them as image/png. Both are accepted by browsers. This tool uses the type reported for your file; if none is reported, it falls back to image/apng. The resulting data URI looks like data:image/apng;base64,iVBORw0KGgo... — note that the Base64 still starts with the regular PNG signature. The only visible difference inside the bytes is the acTL chunk that appears before the first image data.

When to inline an APNG

  • Small animated stickers, badges, and emoji with soft transparent edges.
  • Loading indicators that must look crisp over photos or colored backgrounds.
  • Self-contained HTML demos and documentation pages.

Animated files grow quickly, so inline only short loops of a few kilobytes. For email, prefer GIF to Base64 because many mail clients show only the first APNG frame. For still images, use PNG to Base64, and to check an encoded animation, open Base64 to Image.

Frequently Asked Questions

Both work in modern browsers because they detect the animation from the file itself. image/apng is the officially registered type and documents what the file is; image/png is the most compatible choice for older tools and many build pipelines. If you need the other type, simply replace the prefix — the Base64 part stays the same.

APNG was designed to be backward compatible. Programs that only understand PNG ignore the animation chunks and show the default image (usually the first frame), so nothing breaks.

APNG supports 24-bit color and a full 8-bit alpha channel, so animations can have smooth, anti-aliased edges over any background. GIF is limited to 256 colors and on/off transparency. APNG files are often smaller too, though animated WebP is usually smaller still.