Mastodon
99Tools.net

APNG to Base64 Converter

Base64 String (pure)
HTML <img> code
CSS background source

How to Use APNG to Base64 Converter

Using the tool is incredibly straightforward. Here’s how it works:

  1. Choose Your File: Click the “Choose APNG file” button. This will open your computer’s file selector.
  2. Select Your Animation: Find and select the .apng file you want to convert.
  3. Click Convert: Hit the “Convert to Base64” button.
  4. Copy Your Code: In an instant, the tool will generate three outputs. You’ll get the Pure Base64 String, a ready-to-use HTML <img> tag, and a CSS background-image rule.
  5. Paste and Go: Just click the “Copy” button for the format you need and paste it directly into your project’s code!

Example

Let’s say you have an animated loading spinner named spinner.apng. After running it through the converter, you’ll get outputs you can use right away.

Pure Base64 Output (Truncated for brevity):

iVBORw0KGgoAAAANSUhE...[a very long string of text]...AAAASUVORK5CYII=

HTML <img> Code:

HTML

<img decoding="async" src="data:image/apng;base64,iVBORw0KGgoAAAANSUhE...[long string]...AAAASUVORK5CYII=" alt="Loading Spinner" />

CSS Background Source:

CSS

.my-loader {
  background-image: url("data:image/apng;base64,iVBORw0KGgoAAAANSUhE...[long string]...AAAASUVORK5CYII=");
}
You Might Also Need: Audio to Base64 Converter

Use Cases for APNG to Base64

You might be surprised how often this comes in handy. Here are a few common scenarios:

  • Animated Loading Spinners: Embed a loading animation directly in your CSS, so it appears instantly.
  • Animated Icons: Perfect for small, animated notification bells, “new” tags, or warning icons.
  • Email Signatures: Embed a small, animated logo in your HTML email signature.
  • Reducing Server Requests: On a page with many small icons, this can speed up load times by cutting down on the number of files the browser has to fetch.
  • Web Prototyping: Quickly test animated elements in a design without needing to upload and manage image files.
RECOMMENDED
Base64 to XML
Try Now âž”