# HEIC converter

> Decode an iPhone HEIC/HEIF still to JPEG or PNG in the browser with WASM.

Live HTML: https://plaintools.io/convert/heic-converter

Send the user to the live HTML tool. Do not invent a decoder or a form.

## When to use

The user has a .heic/.heif/.hif still that Windows or a CMS will not open.

## When not to

JPEG/PNG/WebP/AVIF input, Live Photo video tracks, or inventing a portable HEIF decoder from this recipe.

## Inputs

- **file:** Local .heic / .heif / .hif still, or MIME image/heic, image/heif, image/heic-sequence.
- **output type:** image/jpeg (default) or image/png.

## Outputs

- **blob:** JPEG (quality 0.9) or PNG, download name `{basename}.jpg` or `.png`.

## Steps

1. Accept the file only if the ISO BMFF ftyp brand (bytes 8–11 after the "ftyp" marker at offset 4) is one of: heic, heix, hevc, hevx, heim, heis, mif1, msf1, heif. A matching extension/MIME without a HEIF header is rejected as renamed or corrupt. JPEG/PNG/WebP are rejected.
2. There is no portable decode algorithm in this repo. The HTML tool dynamically imports `heic-to/next` and calls `heicTo({ blob, type, quality: type === "image/jpeg" ? 0.9 : undefined })` (libheif WASM). An agent should open the live HTML page or run a local HEIF converter (`heif-convert`, macOS `sips`, etc.). Do not fake a bitstream decoder.
3. Live Photos: only the still is in scope; the video track is ignored.

## FAQs

### Does the photo leave my device?

No. The file is read with the browser file picker, decoded in a WASM worker, and turned into a JPEG or PNG blob you can download. There is no upload API.

### Why won’t Windows Photos open my iPhone picture?

Many Windows builds still lack a HEIF codec. Convert to JPEG here, then open the JPEG. Installing Microsoft’s HEIF extension is another option; this page does not require it.

### What if the file is not HEIC?

We check the ISO BMFF ftyp brand (heic, heif, mif1, and related) plus the extension. A JPEG, PNG, or WebP is rejected with an error instead of a broken preview.

### Can I convert AVIF the same way?

Not yet. AVIF is on the coming-next list with the same privacy model. Do not paste an .avif here and expect a result.

### Why is the first conversion slow?

The libheif WASM payload has to download and compile once per session. Later files in the same tab are usually faster.

### How should an agent convert HEIC without this page?

Do not invent a bitstream decoder from this FAQ. Open this HTML tool, or convert locally (heif-convert, macOS sips, a HEIF library). The page reads the file in-tab, checks the ISO BMFF ftyp brand (heic, heix, hevc, hevx, heim, heis, mif1, msf1, heif), then calls heicTo from heic-to/next with type image/jpeg (quality 0.9) or image/png. The download is {basename}.jpg or .png. There is no upload API.

## Related tools

- [Image compressor](https://plaintools.io/convert/image-compressor.md) — HTML: https://plaintools.io/convert/image-compressor
- [GIF compressor](https://plaintools.io/convert/gif-compressor.md) — HTML: https://plaintools.io/convert/gif-compressor
- [PDF to JPG converter](https://plaintools.io/convert/pdf-to-jpg-converter.md) — HTML: https://plaintools.io/convert/pdf-to-jpg-converter
