What Is HEIC/HEIF Format?
HEIC (High Efficiency Image Container) and HEIF (High Efficiency Image File Format) are modern image formats developed by the Moving Picture Experts Group (MPEG) and standardized as ISO/IEC 23008-12. Apple adopted HEIF as the default photo format for iPhones starting with iOS 11 in 2017, making it the format used for most photos taken on Apple devices worldwide.
The two terms are related but distinct:
- HEIF is the container format specification — it defines how image data is organized in the file
- HEIC is the variant that uses HEVC (H.265) video codec for image compression — this is what iPhones use
- AVIF is a related newer variant using the AV1 codec (not HEVC)
HEIF files use either .heic or .heif extensions (some Android/Samsung devices use .heif). Despite different extensions, they use the same underlying container structure.
Why HEIF Exists: The Problem With JPEG
JPEG was developed in 1992 for hardware capabilities of that era. By the early 2010s, cameras were capturing photos at 12+ megapixels with wide color gamuts, HDR capability, and computational photography features (Live Photos, burst sequences, depth maps) that JPEG simply cannot represent:
| Limitation | JPEG | HEIF Solution |
|---|---|---|
| Bit depth | 8 bits/channel | Up to 16 bits/channel |
| Color gamut | sRGB only | Display P3, Rec. 2020, HDR |
| Transparency | ❌ | ✅ Alpha channel |
| Multiple images | ❌ | ✅ Sequences, bursts, Live Photos |
| Depth maps | ❌ | ✅ Embedded depth data |
| File size | Baseline | ~50% smaller at equal quality |
| Metadata | EXIF only | EXIF, XMP, MPEG-7 |
| Animation | ❌ | ✅ (HEIF sequences) |
HEIF Container Structure
HEIF uses the ISO Base Media File Format (ISOBMFF) container — the same container used by MP4 video files. Inside this container, HEIF organizes data using "boxes" (also called "atoms"):
HEIF File
├── ftyp box — File type and compatible brands (heic, mif1, etc.)
├── meta box — Metadata container
│ ├── hdlr box — Handler type ('pict' for images)
│ ├── dinf box — Data information
│ ├── iloc box — Item location (byte offsets for each image/item)
│ ├── iinf box — Item information
│ ├── iprp box — Item properties (transforms, color info, auxiliary)
│ │ ├── ispe — Image spatial extents (width/height)
│ │ ├── colr — Color information (ICC profile or nclx)
│ │ ├── hvcC — HEVC decoder configuration
│ │ ├── pasp — Pixel aspect ratio
│ │ └── irot — Image rotation
│ ├── grpl box — Item grouping (defines sequences, alternatives)
│ └── iref box — Item references (thumbnail → primary, auxiliary → primary)
└── mdat box — Media data (raw compressed image data)
This structure allows HEIF to store multiple items (images, thumbnails, depth maps, gain maps) in a single file with clear relationships between them.
HEVC Compression in HEIC
HEIC images are compressed using HEVC (High Efficiency Video Coding / H.265), the same codec used for 4K/8K video. HEVC achieves roughly twice the compression efficiency of H.264/AVC at the same visual quality.
For still images, HEVC can encode individual frames using intra-frame coding (no inter-frame prediction needed). The compression uses:
- CTU (Coding Tree Units) — flexible block sizes from 4×4 to 64×64 pixels
- Intra prediction — predicts pixel values from neighboring decoded pixels (35 directions in HEVC vs. 9 in H.264)
- Transform coding — DCT and DST transforms (up to 32×32 in HEVC)
- Entropy coding — CABAC (Context-Adaptive Binary Arithmetic Coding)
- In-loop filtering — deblocking and SAO (Sample Adaptive Offset) filters
This sophisticated compression pipeline is why HEIC files are roughly half the size of equivalent JPEG files at the same perceived quality.
HEIF Multi-Image Capabilities
One of HEIF's most powerful features is storing multiple images in a single file with defined relationships:
Live Photos (Apple)
A Live Photo is a HEIF file containing:
- The main still image (HEIC compressed)
- A short video clip (HEVC encoded)
- Metadata linking the two
The .heic extension is used even for Live Photos; the video portion is stored as a separate moov box within the container.
Burst Sequences
Multiple photos from a burst shot stored in one file with one designated "primary" image. Reduces storage overhead vs. individual JPEG files per frame.
Depth Maps
Portrait mode photos store the main image plus a monochrome depth map used for rendering the bokeh (background blur) effect. The depth map is referenced as an auxiliary image item.
Gain Maps (HDR)
Apple's implementation of HEIF HDR stores a "gain map" alongside the standard dynamic range base image. Tone mapping applies the gain map on HDR-capable displays while showing the base image on SDR screens — a single file adapts to the display.
Image Sequences / Animations
HEIF supports animation by storing multiple image items and a track structure (like video), enabling GIF/APNG replacement with HEVC quality.
HEIF Color and HDR
HEIF's color capabilities far exceed JPEG:
| Feature | JPEG | HEIF |
|---|---|---|
| Bit depth | 8 bpc | 8, 10, 12, 16 bpc |
| Color spaces | sRGB | sRGB, Display P3, Rec. 2020, ACES, custom ICC |
| HDR support | ❌ | ✅ HLG, PQ, gain maps |
| Wide gamut | ❌ | ✅ |
iPhone cameras use Display P3 wide color gamut by default. HEIC files correctly embed the color profile, ensuring accurate color reproduction on P3-capable displays (all modern iPhones, iPads, Macs, and many other devices).
Compatibility and Support
Native HEIC Support
- Apple: Full support on macOS High Sierra+, iOS 11+, iPadOS, tvOS, watchOS
- Windows 11: Built-in HEIC viewer; Windows 10 requires the free "HEIF Image Extensions" from the Microsoft Store
- Android: Support varies; Samsung, Google Pixel, and most modern Android phones can view HEIC. Some older Android versions cannot.
- Linux: Support via libheif; most distros don't include it by default
Web Browser HEIC Support
- Safari: ✅ Native
- Chrome: ✅ (Chrome 85+)
- Firefox: ❌ (as of 2024, still no native HEIC support)
- Edge: ✅ (via Windows HEIF codec)
For maximum web compatibility, convert HEIC to JPEG or WebP before displaying on websites.
Software Support
| Software | HEIC Import | Notes |
|---|---|---|
| Photos (macOS/iOS) | ✅ Native | Full fidelity including Live Photos |
| Lightroom Classic | ✅ | Full editing |
| Photoshop | ✅ (2019+) | Requires HEVC codec on Windows |
| GIMP | ✅ (via plugin) | Requires libheif |
| ImageMagick | ✅ | Requires libheif |
| Affinity Photo | ✅ |
Converting HEIC Files
HEIC → JPEG (macOS)
# Using sips (built-in macOS tool)
sips -s format jpeg photo.heic --out photo.jpg
# Batch convert entire folder
for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done
HEIC → PNG (macOS)
sips -s format png photo.heic --out photo.png
HEIC → JPEG (Windows)
Use the built-in Photos app: Open → Export → Save as JPEG. Or use ImageMagick:
magick convert photo.heic photo.jpg
HEIC → WebP (all platforms via ImageMagick)
magick convert photo.heic photo.webp
HEIF vs. AVIF
AVIF is a newer image format using the AV1 codec instead of HEVC. Google and others developed AVIF as a royalty-free alternative to HEIC:
| Feature | HEIC | AVIF |
|---|---|---|
| Codec | HEVC (H.265) | AV1 |
| Patent royalties | Yes (HEVC pool) | No (royalty-free) |
| Compression efficiency | High | Slightly higher |
| Encoding speed | Fast | Slow |
| Browser support | Safari, Chrome, Edge | Chrome, Firefox, Edge |
| Apple ecosystem | ✅ Native | Limited |
| Web adoption | Growing | Growing faster |
For web use, AVIF is increasingly preferred due to its royalty-free status. For Apple device workflows, HEIC remains the standard.
Related conversions
Most teams that read this guide convert images in one of these directions: