Tutorial · images · Published 2026-08-16 · 3 min read

Serving HEIC iPhone photos on the web

HEIC photos and the web: why browsers cannot render HEIC, when to convert to JPEG, WebP or AVIF, and how to build the conversion into a pipeline.

Flat editorial illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: this article at a glance.

If your photos come from an iPhone, they are probably HEIC. Apple made HEIC, stored in the HEIF container, the default camera format on iPhones since iOS 11, because it stores roughly half the data of JPEG at equal quality while keeping 10-bit colour and Live Photo metadata. That efficiency is a storage win on the phone and a problem on the web: except for Safari, which renders HEIC natively on macOS and iOS, no mainstream browser decodes HEIC, so an HEIC file served to Chrome, Firefox or Edge shows as a broken image. The driving rule is that you must convert HEIC to a browser-supported format before it reaches the CMS or the page.

Editorial close-up illustration showing layered photo frames with a visible file-size meter and a compression bar, grid of thumbnails receding.
Illustration: a closer look at the technique described above.

Why HEIC breaks the page

Most websites never see the HEIC file because their upload forms or CMS convert it. The failure appears when one slips through: an HTML img pointing at a .heic file, or a CMS media library storing HEIC directly, shows the browser's broken image icon because the browser has no HEIC decoder. Some platforms reject HEIC at upload, which is why a photo that works on the phone can fail to upload to a website. The fix is always a conversion step upstream, before the file is treated as a web asset.

Pick an output format

The target format depends on how much compatibility you need and whether you control the serving markup:

The practical pattern for a website is the picture ladder: AVIF first, WebP second, JPEG last, which the conversion guide in the AVIF pipeline article shows in markup.

Build it into a pipeline

Convert once at the source so the web never sees HEIC. Options from simplest to most repeatable:

  1. Adjust the phone so it stops producing HEIC for the use case: set Settings, Camera, Formats, Most Compatible to capture JPEG, which removes the conversion question for direct photos.
  2. Convert manually with a file tool that decodes HEIC, such as a drag-and-drop converter or an image editor that imports HEIF.
  3. Convert in a script for a batch, which is the right route for a photo library. Command line tools that handle HEIC decoding, from the command line image tools, read HEIF and can emit WebP or AVIF, and the CI conversion article shows how to make it a checked build step so a raw HEIC can never ship.

Whichever route you pick, verify the output has a browser-supported extension and MIME type and renders before it goes live. A servable WebP or AVIF that decodes correctly is the whole job; the remaining optimisation (sizing, quality, metadata) follows the same rules as any other image, covered by the image compression guide and the CLI tools guide that this workflow extends.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services