DevToolsmith

HEIC MIME Type

image/heic is the MIME type for HEIC photos, the default format of iPhone cameras. Here is the Content-Type header to send, the file signature, and how to configure servers and code.

MIME type
image/heic
Extensions
.heic, .heif
Content-Type header
image/heic
Registered
Yes, with IANA
Compress with gzip
No, it is already compressed
Category
Images

About HEIC image files

iPhones save photos as HEIC, and only Safari can display them. iOS usually converts them to JPEG when you pick a photo in a web upload form, but not always (for example, files shared from the Files app). If your app accepts photo uploads, either convert HEIC on the server or reject it with a clear message.

Other types seen for these files: image/heif , image/heic-sequence . Accept them when reading uploads, but send image/heic yourself.

File signature

HEIC files start with "ftypheic" (or ftypmif1, ftypheix) at byte 4. The extension and the type a browser reports for an upload both come from the file name, so check these bytes on the server before trusting a file.

Serve .heic with the right Content-Type

Response header
Content-Type: image/heic
nginx (a line in the types { } block of mime.types)
image/heic heic heif;
Apache (.htaccess or server config)
AddType image/heic .heic .heif
Caddy
@heic path *.heic *.heif
header @heic Content-Type "image/heic"
Check what a server sends
curl -sI https://example.com/file.heic | grep -i '^content-type'
# Content-Type: image/heic

Set the type in code

Node.js (Express)
res.set('Content-Type', 'image/heic');
// Or make the browser download it:
res.attachment('file.heic');
Python
import mimetypes

mimetypes.add_type('image/heic', '.heic')  # if your system doesn't know it
mimetypes.guess_type('file.heic')[0]  # 'image/heic'
Go
mime.AddExtensionType(".heic", "image/heic")
w.Header().Set("Content-Type", "image/heic")

Accept .heic uploads

HTML
<input type="file" accept=".heic,.heif,image/heic">

The accept attribute only filters the file picker; users can still choose another file. Listing the extension as well as the type matters, because operating systems don’t always report the type you expect.

Related types

  • .jpg (image/jpeg): JPEG image
  • .avif (image/avif): AVIF image
  • .png (image/png): PNG image

More images

.gif , .webp , .ico , .bmp , .tiff . Look up any extension or type with the MIME type lookup.

Sources

Spotted a mistake? Email hello@devtoolsmith.com and we’ll fix it.

Frequently asked questions

What is the MIME type for .heic files?

image/heic. You may also see image/heif, image/heic-sequence, which are older or unofficial; send image/heic. The full header is "Content-Type: image/heic".

Why does my server send the wrong Content-Type for .heic?

Web servers pick the type from the file extension using a table (mime.types in nginx and Apache). If .heic is missing from that table, they send a default such as application/octet-stream or text/plain. Add the mapping as shown on this page, then check the response with "curl -sI".

How can I check that a file really is HEIC?

Look at the first bytes rather than the extension or the type the browser reports, which both come from the file name. HEIC files start with "ftypheic" (or ftypmif1, ftypheix) at byte 4. The MIME type lookup on this site reads them for you when you drop a file on it.