Image Format Converter — JPG, PNG, WebP, AVIF, HEIC
Convert images between JPG, PNG, and WebP entirely in your browser — and decode AVIF or HEIC inputs without installing a thing. Batch up to 50 files at once, files never leave your device, sources cited below.
How it works
Every modern browser ships with two pieces of image infrastructure: a decoder that wires into the <img> element for every format the browser supports, and an encoder reachable through one Web API: HTMLCanvasElement.toBlob(callback, mimeType, quality). The converter chains the two together — decode your source into an off-screen canvas, then ask the browser to re-encode it as the target format. No file leaves the page; open your browser's Network tab while using the tool to confirm.
The decoder side is broad: every browser handles JPG, PNG, WebP, GIF, and BMP; AVIF is decodable on Chrome / Edge 85+, Firefox 113+, and Safari 16+; HEIC is decodable only on Safari for Apple devices, because Apple holds the patent licence. The encoder side is narrower — canvas.toBlob produces JPEG, PNG, and WebP in every browser, but no browser today exposes a canvas AVIF or HEIC encoder. The tool detects what your browser actually supports on load and surfaces a clear message when you try to read or write a format the browser can't handle.
Output file size is the product of three factors: pixel count (twice the pixels, roughly twice the bytes), encoder family (WebP averages 25–34% smaller than JPEG at the same perceptual quality, per Google's 2010 / 2016 WebP study; AVIF runs another ~20% smaller again on photographic content), and quality setting on the 0..1 scale that toBlob accepts. The size estimator surfaced in the calculator uses an empirical bits-per-pixel curve fitted to JPEG corpora and cross-checked against the WebP study:
bpp_jpeg(q) = 0.05 + 1.4 × (q / 100)^2.5 bpp_webp(q) = bpp_jpeg(q) × 0.70 bpp_avif(q) = bpp_jpeg(q) × 0.56 bytes = (pixels × bpp) / 8 + ~1 KB header overhead
The 0.05 floor accounts for the bits-per-pixel a JPEG still needs for its quantised DCT coefficients and Huffman tables even at quality 0. The 2.5 exponent captures the steep growth in size between q=60 and q=90 — the band where most visible detail is preserved. The estimator is cross-checked against a second formula that linearly interpolates a five-point lookup table; the two land within ±5% on every quality between 1 and 100. The page surfaces both so you can see the agreement on each worked example below.
For every image in the batch the tool does five deterministic things:
- Recognise. Read the file's MIME type if the browser reports one, otherwise fall back to the filename extension. Falling back matters because some drag-drop paths and Linux file pickers drop the MIME entirely.
- Validate. Reject anything over 50.0 MBor any format your current browser can't decode (HEIC outside Safari, AVIF on legacy browsers) with a specific reason instead of a silent failure.
- Decode. Load the source into an
HTMLImageElementso the browser uses its native decoder. Read dimensions fromnaturalWidth/naturalHeight. - Re-draw. Paint the image onto a fresh canvas at its source dimensions with
imageSmoothingQuality = "high". For JPEG / BMP targets, pre-fill the canvas with white so transparent source pixels don't turn black on encode. - Encode & download.
canvas.toBlobproduces the converted Blob at the target MIME and quality. The tool wraps it in an object URL and offers the download with the target file extension applied to the source filename.
Worked examples
Format compatibility at a glance
What your browser can read and write changes every year as new codecs ship. Here is what every shipping browser handles today.
| Format | Read | Write | Transparency | Best for |
|---|---|---|---|---|
| JPEG | Every browser | Yes (canvas) | No | Photographs. Smallest universally compatible format. No transparency. |
| PNG | Every browser | Yes (canvas) | Yes | Lossless. Logos, icons, screenshots, anything with transparency. |
| WebP | Every browser | Yes (canvas) | Yes | 25–34% smaller than JPEG at equal quality. Supports transparency. |
| AVIF | Chrome / Edge 85+, FF 113+, Safari 16+ | Not in any browser | Yes | Newest format — decode in Chrome / Edge / Safari 16+. Browsers can't encode yet. |
| HEIC | Safari only | Not in any browser | Yes | iPhone default. Decode in Safari only — convert to JPEG for sharing. |
| GIF | Every browser | Not in any browser | Yes | Decodes everywhere; canvas cannot re-encode GIFs (only the first frame). |
| BMP | Every browser | Not in any browser | No | Legacy uncompressed bitmap. Decodes in every browser; rarely useful as output. |
Frequently asked questions
Sources & references
- MDN — HTMLCanvasElement.toBlob (browser-native JPEG / WebP / PNG encoder)
- MDN — Image file type and format guide (which formats each browser decodes)
- Google — WebP Compression Study (25–34% smaller than JPEG)
- AOMedia — AV1 Image File Format (AVIF) specification
- web.dev — AVIF (decoder availability, encoder absence in browsers)
- Apple Developer — Image I/O (HEIF / HEIC on iOS and macOS)
The decoder / encoder availability table and the cited compression-vs-quality relationships were last cross-checked against the above sources on 2026-05-11. The page is reviewed when a major browser ships a new image encoder or when the WebP study is refreshed.
Related tools
Comments & feedback
Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.
Found a bug, edge case, or want to suggest an improvement?
Email me at [email protected] — most fixes ship within 24 hours.