Skip to content

High Efficiency Image Container (.heic)

.heic file signature | image/heic

High Efficiency Image Container (HEIC) is a container format for still images and image sequences, defined by the Moving Picture Experts Group (MPEG) and standardized within the ISO/IEC HEIF family. It is used on mobile devices and in photo libraries for storing compressed photographs, burst images, and sequences with smaller file sizes than older formats. HEIC is widely supported in modern systems; files from untrusted sources should still be handled with updated software, as decoding vulnerabilities have occasionally affected image libraries.

Safe

Magic Bytes

Offset 4
66 74 79 70 68 65 69 63

Sources: Apache Tika, Wikipedia, Gary Kessler

All Known Signatures

3 signature variants are documented for .heic files across multiple sources.

Hex Signature Offset Sources
66 74 79 70 68 65 69 63 4 Apache Tika, Wikipedia, Gary Kessler
66 74 79 70 68 65 69 78 4 Apache Tika
66 74 79 70 6D 4 Wikipedia

Extension

.heic

MIME Type

image/heic

Byte Offset

4

Risk Level

Safe

Validation Code

How to validate .heic files in Python

Python
def is_heic(file_path: str) -> bool:
    """Check if file is a valid HEIC by magic bytes at offset 4."""
    signature = bytes([0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63])
    with open(file_path, "rb") as f:
        f.seek(4)
        return f.read(8) == signature

How to validate .heic files in Node.js

Node.js
function isHEIC(buffer: Buffer): boolean {
  const signature = Buffer.from([0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63]);
  if (buffer.length < 12) return false;
  return buffer.subarray(4, 12).equals(signature);
}

How to validate .heic files in Go

Go
func IsHEIC(data []byte) bool {
    signature := []byte{0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63}
    if len(data) < 12 {
        return false
    }
    return bytes.Equal(data[4:12], signature)
}

API Endpoint

GET /api/v1/heic
curl https://filesignature.org/api/v1/heic

See the full API documentation for all endpoints and parameters.

Related Formats

Frequently Asked Questions

What is a .heic file?

A .heic file is a High Efficiency Image Container file. High Efficiency Image Container (HEIC) is a container format for still images and image sequences, defined by the Moving Picture Experts Group (MPEG) and standardized within the ISO/IEC HEIF family. It is used on mobile devices and in photo libraries for storing compressed photographs, burst images, and sequences with smaller file sizes than older formats. HEIC is widely supported in modern systems; files from untrusted sources should still be handled with updated software, as decoding vulnerabilities have occasionally affected image libraries.

What are the magic bytes for .heic files?

The magic bytes for High Efficiency Image Container files are 66 74 79 70 68 65 69 63 at byte offset 4. These bytes uniquely identify the file format regardless of the file extension.

How do I validate a .heic file?

To validate a .heic file, read the first bytes of the file and compare them against the known magic bytes (66 74 79 70 68 65 69 63) at offset 4. This is more reliable than checking the file extension alone, as extensions can be renamed.

What is the MIME type for .heic files?

The primary MIME type for .heic files is image/heic.

Is it safe to open .heic files?

High Efficiency Image Container (.heic) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.