File types · Explainer

The HEIF file (.heif, .hif)

A HEIF file is an image container from MPEG, built like an MP4 video file, that can hold one picture or many, compressed with HEVC, AV1, JPEG or other codecs, plus thumbnails, depth maps and metadata. This guide explains how HEIF relates to HEIC and AVIF, what's inside a file, the .HIF photos some cameras save, and how to open and convert them.

At a glance

Full name
High Efficiency Image File Format (HEIF)
Extensions
.heif and .hif for images, .heifs for image sequences; HEIC and AVIF files are HEIF with their own extensions
MIME type
image/heif (image/heif-sequence for sequences); image/heic and image/avif for those flavours
Kind
Binary container for coded images, image sequences and metadata, based on the ISO base media file format (the structure of MP4)
Standard
ISO/IEC 23008-12 (MPEG-H Part 12), from MPEG
First released
Finalised in 2015 and published in 2017; Apple adopted it in iOS 11 and macOS High Sierra (2017)
Codecs inside
HEVC (as HEIC), AV1 (as AVIF), H.264, JPEG, VVC, JPEG 2000 and uncompressed images
Brands
mif1 for images and msf1 for sequences, plus codec brands such as heic, heix, avci, jpeg and avif
Magic number
None fixed: 66 74 79 70 (ftyp) from byte 4, after a 4-byte box size, then the brands
Opens with
Apple devices; Windows with Microsoft's HEIF (and HEVC) extensions; most Android phones; GIMP, ImageMagick and other libheif-based tools

The basics

What is a HEIF file?

HEIF, the High Efficiency Image File Format, is a container for images standardised by MPEG as ISO/IEC 23008-12. It doesn't define how pixels are compressed. Instead it borrows the box structure of MP4 and says how to store coded images, how they relate to each other, and what metadata goes with them. One file can hold a single photo, a burst, an exposure bracket, a thumbnail, a depth map, an alpha plane or an image sequence.

The codec inside gives each flavour its name, and usually its extension:

Codec insideBrandUsual extensionWhere you meet it
HEVC (H.265)heic, heix`.heic`, .hifiPhone and iPad photos; Canon, Sony and Fujifilm cameras
AV1avif`.avif`Images on websites; every current browser shows them
H.264 (AVC)avci.heifRare; for devices with H.264 but no HEVC hardware
JPEGjpeg.heifRare; ordinary JPEG data with HEIF's multi-image features
JPEG 2000j2ki.heifSpecialist; defined in JPEG 2000 Part 16 (JP2)
VVC (H.266)vvic.heifNewer; little software support yet
Uncompressed(unci items).heifScientific and industrial imaging (ISO/IEC 23001-17)

So every HEIC and every AVIF file is a HEIF file, but a .heif file isn't necessarily either. In practice most .heif and .hif files still contain HEVC, because that's what phones and cameras write.

Anatomy

What's inside a HEIF file

There are no sample files on this page, so to show real bytes we made a small HEIF file with pillow-heif (which uses libheif and the x265 encoder), laid out the way a camera lays out a .HIF photo: a 10-bit picture stored as a grid of tiles, with a thumbnail and Exif data, plus a second, separate image. Like an MP4, the file is a series of boxes, each starting with a 4-byte size and a 4-letter type. Pictures are items, described in the meta box; their coded bytes sit in mdat.

A 1024 × 768 10-bit HEIF (hex and box map)
00 00 00 1C  66 74 79 70  68 65 69 78  00 00 00 00
6D 69 66 31  68 65 69 78  6D 69 61 66

offset  box          size  contents
000000  ftyp           28  major brand "heix"; also mif1, heix, miaf
00001C  meta        1,044  everything except the coded pixels
000028    hdlr         33  handler "pict": the items are pictures
000049    idat         16  grid layout: 2 × 2 tiles, output 1024 × 768
000059    iloc        176  where each item's bytes are
000109    iinf        182  eight items:
                             1     grid  the primary picture
                             2–5   hvc1  four 512 × 512 tiles (hidden)
                             6     Exif  Exif metadata (hidden)
                             7     hvc1  a 256 × 192 thumbnail
                             8     hvc1  a second, separate 480 × 360 image
0001BF    pitm         14  the primary item is item 1
0001CD    iprp        551  properties, and which item has which
0001D5      ipco      480  ispe 1024 × 768, hvcC, colr (nclx),
                           ispe 512 × 512, pixi 10-bit, hvcC,
                           ispe 256 × 192, hvcC, ispe 480 × 360
0003B5      ipma       63
0003F4    iref         60  dimg: item 1 is built from items 2 to 5
                           cdsc: item 6 describes item 1
                           thmb: item 7 is a thumbnail of item 1
000430  mdat        9,163  HEVC data for the tiles, the thumbnail
                           and item 8, plus the Exif block
                           end of file at 10,235 bytes
  1. 100 00 00 1C 66 74 79 70 68 65 69 78

    The ftyp box and brands

    Size 28, ftyp, then the major brand heix: HEVC images using the Main 10 or range-extension profiles, here at 10 bits. The compatible brands follow: mif1 says the file is a HEIF image file whatever the codec, and miaf that it also follows the stricter MIAF rules. Software decides what it can open from this list, not from the extension.

  2. 2hdlr: pict

    The handler

    The meta box starts by saying its items are pictures. In a sequence, a moov box with a pict track holds the frames instead, the way an MP4 holds video.

  3. 3idat: 00 00 01 01 04 00 03 00

    A derived image: the grid

    Item 1 has no pixels of its own. Its 8 bytes of data say: version 0, flags 0, rows minus one (01, so 2), columns minus one (01, so 2), and an output size of 04 00 by 03 00, 1024 × 768. Two 512-pixel tiles make 1,024 across but 1,024 down too, so the decoder crops the bottom.

  4. 4iinf: grid, hvc1 × 4, Exif, hvc1, hvc1

    The items

    Each item has a number and a type: hvc1 for HEVC-coded images, grid for the derived picture, Exif for metadata. Items 2 to 6 are flagged hidden, so a viewer won't list the tiles or the Exif block as pictures. Item 8 is a second, independent image, the way HEIF stores bursts, brackets or alternatives in one file.

  5. 5pitm: item 1

    The primary item

    The picture a viewer opens. Viewers that know nothing about collections show this one and ignore item 8.

  6. 6ipco: ispe, hvcC, colr, pixi

    Item properties

    Size (ispe), decoder settings (hvcC: HEVC at 10 bits, 4:2:0), colour (colr, here BT.709 primaries with the sRGB transfer curve) and bit depth (pixi). ipma links them to items, and marks which ones are essential. Properties such as irot (rotation), imir (mirroring) and clap (crop) change how an item is shown without re-encoding it.

  7. 7iref: dimg, cdsc, thmb

    References between items

    dimg lists the tiles a derived image is built from, cdsc attaches metadata to a picture, and thmb marks a thumbnail. Others link auxiliary images, such as an alpha plane or a depth map, to their picture.

  8. 8mdat

    The media data

    The coded bytes of every item, found through iloc. Each HEVC tile is a run of NAL units, each preceded by its length in 4 bytes, as in an MP4 video track.

Under the hood

Items, properties and derived images

Still images in a HEIF file are items. Each item has a type, and its data can be found through the item location box (iloc). Properties (size, colour, decoder settings, rotation) are stored once and shared between items. References say how items relate. Image sequences, such as bursts or short animations, are stored as tracks instead, like the video in an MP4.

Some items have no coded pixels. They're derived images, recipes that build a picture from other items:

Item typeWhat it does
gridJoins tiles into one picture. Phones and cameras split large photos into tiles of 512 × 512 or so, which keeps each one within the limits of hardware decoders.
iovlOverlay: places several images on a canvas at given positions, over a background colour.
idenIdentity: the same image as its input, so that it can carry its own rotation, mirroring or crop while the original stays untouched. An editor can rotate a photo this way without re-encoding it.
tmapTone map: combines a base image and a gain map so an HDR screen can show a brighter version.

Other items are auxiliary: an alpha plane for transparency, or a depth map from a phone's portrait mode, linked to their picture with an auxl reference and usually hidden. A file can also group items as alternatives of each other (an altr group), so a reader shows one of them.

Why HEIF files are hard to support well

A decoder that handles one HEVC image isn't a HEIF reader yet. It also has to assemble grids, apply rotation, mirroring and crop in the right order, combine alpha planes, and pick the primary item. Simple tools that skip these steps show a single tile, the thumbnail, or a sideways photo.

Identify

Brands: how software tells HEIF files apart

HEIF has no fixed signature; its media type registration says so. The first box is always ftyp, so bytes 4 to 7 read ftyp, followed by a major brand and a list of compatible brands. Each brand is a four-letter promise that the file follows a certain set of rules. The brands registered with the MP4 Registration Authority include:

BrandMeans
mif1HEIF structural brand for image items, whatever the codec
msf1HEIF structural brand for image sequences
miafAlso follows MIAF (ISO/IEC 23000-22), a stricter profile that limits codecs and features so files work in more places
heic, heixHEVC images: heic for 8-bit Main profiles, heix for 10-bit and range extensions
hevc, hevxHEVC image sequences
avci, avcsH.264 images and image sequences
jpeg, jpgsJPEG images and image sequences
avif, avisAV1 images and image sequences (AVIF)

A file-type checker should therefore read the ftyp box rather than the extension: a .heif file may say heic and decode like an iPhone photo, or say avci and need an H.264 decoder. The same check tells an AVIF or HEIC file from an MP4 video, which also starts with ftyp.

Cameras

.HIF files from Canon, Sony and Fujifilm cameras

Many recent mirrorless cameras can save photos as HEIF instead of JPEG, with the .HIF extension. The format inside is HEVC, as in an iPhone's HEIC, but usually at 10 bits per channel, which keeps smooth gradients and leaves more room for editing than an 8-bit JPEG. The .hif extension was added to the HEIF standard in 2020, and is registered for both image/heif and image/heic.

  • Canon introduced HEIF with the EOS-1D X Mark III in 2020, followed by the EOS R5 and R6. On Canon cameras it goes with the HDR PQ setting, which records high dynamic range photos for HDR screens.
  • Sony cameras offer HEIF at 10 bits with 4:2:0 colour, for smaller files, or 4:2:2, for more colour detail. Sony's Imaging Edge Desktop converts them to JPEG or 16-bit TIFF.
  • Fujifilm cameras also save 10-bit HEIF, as .HIF files, as an alternative to JPEG.

Not every app that opens iPhone photos opens these. Some don't recognise the .hif extension, some can't decode 10-bit or 4:2:2 HEVC, and HDR PQ photos look flat or washed out in software that treats them as ordinary images. Canon's Digital Photo Professional and Sony's Imaging Edge Desktop handle their own cameras' files, and Apple's Photos and Preview open many of them.

Compatibility

Where HEIF files open

WhereHEIF support
iPhone, iPad, MacYes, since iOS 11 and macOS 10.13 High Sierra (HEVC flavours; AVIF since iOS 16 and macOS 13)
Windows 10 and 11With HEIF Image Extensions from the Microsoft Store; HEVC-coded files also need HEVC Video Extensions
AndroidDecoding on most devices since Android 9
BrowsersAVIF in every current browser; HEIC in Safari only; other HEIF flavours generally not at all
Linux and cross-platform toolsThrough libheif: GIMP, ImageMagick, GraphicsMagick, many viewers, and pillow-heif for Python

As with HEIC, the container is rarely the problem. Whether a file opens depends on the codec inside: HEVC is covered by patent licences, so free software often relies on the operating system's decoder, while AV1 is royalty-free and widely available. See our HEIC page for the details.

How to

How to open a HEIF file and convert it to JPG

  • On a Mac: double-click to open in Preview, then File > Export to save as JPEG or PNG. In Terminal: sips -s format jpeg photo.heif --out photo.jpg.
  • On Windows: install HEIF Image Extensions and, for HEVC files, HEVC Video Extensions, then open the file in Photos and save a copy as JPEG.
  • From a camera: the maker's software (Canon Digital Photo Professional, Sony Imaging Edge Desktop) opens and converts its own .HIF files, including 10-bit and HDR versions.
  • On Linux or anywhere else: libheif's tools inspect and convert: heif-info photo.heif lists every item, and heif-dec photo.heif photo.png (heif-convert in older versions) converts it. ImageMagick does the same with magick photo.heif photo.jpg.
  • In Python: pillow-heif adds HEIF to Pillow: pillow_heif.register_heif_opener(), then Image.open("photo.heif") as usual.
  • Keep 10-bit detail: convert to 16-bit PNG or TIFF rather than JPEG if you plan to edit further.

Troubleshooting

Common HEIF problems

  • Windows asks for an extension. HEIF Image Extensions reads the container; the HEVC Video Extensions decode HEVC images inside it. Both are needed for HEIC and most .HIF files.
  • The app opens iPhone photos but not camera files. Check the extension (try opening a copy renamed to .heic), then the codec: 10-bit and 4:2:2 HEVC need a decoder that supports them.
  • Only part of the image, or a tiny image, appears. The reader didn't assemble the grid, or showed the thumbnail. Use a libheif-based tool.
  • The photo is sideways after converting. HEIF stores rotation as an irot property. A converter that applies it and also copies the Exif orientation tag into the JPEG turns the picture twice.
  • Only one image of a burst comes out. Most viewers show the primary item only. heif-info lists the rest, and libheif's tools or pillow-heif can extract them.
  • Hidden extras. Depth maps, thumbnails and Exif data, including GPS location, travel with the file. Strip metadata with exiftool -all= photo.heif, or convert to JPEG, before sharing publicly.

Sample files

There are no sample HEIF files on this page yet. To make one for testing, install pillow-heif (pip install pillow-heif) and run python3 -c "import pillow_heif; from PIL import Image; pillow_heif.register_heif_opener(); Image.open('input.png').save('output.heif')", or use the HEIC samples, which are HEIF files too.

Put it online

Have a HEIF file? Give it a link.

Drop a HEIF or .HIF file on 99helpers and it gets its own web address to share. Browsers don't display HEIF, so anyone who opens the link downloads the file; add a JPEG copy if people should see the picture straight away.

Questions

HEIF files, frequently asked

What is a HEIF file?

An image file in the High Efficiency Image File Format, an MPEG container that can hold one or more images compressed with HEVC, AV1, JPEG or other codecs, plus thumbnails and metadata.

What's the difference between HEIF and HEIC?

HEIF is the container. HEIC is a HEIF file whose images are compressed with HEVC, the format iPhones use. A .heif file usually contains HEVC too, but may use another codec.

Is AVIF a HEIF file?

Yes. AVIF is HEIF with AV1-compressed images. Because AV1 is royalty-free, every current browser shows AVIF, while HEIC works only in Safari.

What is a .HIF file?

A HEIF photo from a camera: Canon, Sony and Fujifilm use the .HIF extension. It usually contains 10-bit HEVC images and opens like a HEIC file in software that supports it.

How do I open a HEIF file on Windows?

Install HEIF Image Extensions and HEVC Video Extensions from the Microsoft Store, then open it in Photos. Alternatively, use GIMP or ImageMagick.

How do I convert HEIF to JPG?

On a Mac, open it in Preview and choose File > Export > JPEG. On Windows, open it in Photos (with the extensions) and save a copy. On the command line: heif-dec photo.heif photo.jpg or magick photo.heif photo.jpg.

Can a HEIF file hold several images?

Yes: bursts, brackets, alternatives, thumbnails, depth maps and image sequences. Most viewers show only the primary image; heif-info lists everything inside.

Is HEIF lossless?

It depends on the codec. Photos from phones and cameras are lossy HEVC, but HEIF can also hold lossless HEVC or AV1, and uncompressed images.

Related formats

Other file types explained

Keep going

Related

Sources

Last reviewed 27 October 2026.