DEV Community

Cover image for HEIC vs JPG: File Size, Quality and Compatibility
Zaire Prow
Zaire Prow

Posted on Originally published at heicly.io

HEIC vs JPG: File Size, Quality and Compatibility

Every HEIC-versus-JPG discussion eventually collapses into a single sentence: Apple's format is more efficient, and the rest of the world pretends it does not exist. That is accurate, but it is not actionable. What you need to know is how much smaller, how much worse, and where the file will fail to open.

So this is the practical version: spec facts, a size measurement on three real phone photos, and a decision rule at the end.

Side by side

HEIC JPG
Nature HEIF container wrapping HEVC-compressed picture data JPEG, the format photos defaulted to for three decades
Specification HEIF, ISO/IEC 23008-12 ISO/IEC 10918-1 and ITU-T T.81, ratified 1992
Size at equal perceived quality Smaller, per Apple's own description Larger; measured at 1.4–1.7x the HEIC at quality 90
Payload Several images, burst sets, alpha, depth maps, up to 16 bits/sample Normally one picture
Opens in a browser Safari 17+ only Every browser
Opens on Windows Only with Microsoft's HEIF and HEVC packages Out of the box

So what is a HEIC file, really

When an iPhone writes .heic, it is producing a HEIF container whose image payload was encoded with HEVC. Apple brought that combination to iOS 11 and macOS High Sierra, and its stated pitch is straightforward: stronger compression than JPEG or H.264 without a visible drop in quality, so photos eat less of your phone and less of iCloud.

The container matters more than people assume. HEIF was designed to hold a bundle rather than a single frame: burst sequences, alpha transparency, depth information used for portrait effects, and sample depths beyond the 8 bits that consumer cameras traditionally used, up to 16.

It is also not an Apple monopoly. Two of the three phones I measured below are Samsungs, and both wrote HEIC natively.

The numbers, from three real photos

Three 12-megapixel shots, converted in desktop Chrome, sizes recorded. Worth stating plainly: these JPGs are new encodings derived from the HEIC, not the file an iPhone would have written had the camera been set to JPEG.

Phone (per Exif) HEIC quality 90 quality 75
iPhone 7 0.88 MB 1.49 MB (1.70x) 0.81 MB (0.92x)
iPhone 12 Pro 1.72 MB 2.55 MB (1.48x) 1.52 MB (0.88x)
Samsung SM-A326B 1.22 MB 1.70 MB (1.40x) 0.91 MB (0.74x)

(MB here means 1,000,000 bytes. Capture date and camera metadata survive the conversion.)

Read the middle column and the surprising headline appears: converting at the default quality makes the file bigger, by 40 to 70 percent. The third column shows the escape hatch, quality 75, which lands at or below the original size while accepting more visible compression.

There is a fourth data point worth knowing because it inverts the assumption entirely. A Samsung SM-S906U motion photo arrived as a 3.68 MB HEIC containing roughly 3.2 MB of embedded video. Stripping that video and keeping the still frame produced a 1.30 MB JPG, less than half the source. An unexpectedly huge HEIC is often a container with more than one thing inside it.

None of these ratios are laws. They describe three photos, and your mileage will vary with scene complexity, ISO noise and how much the camera already smoothed.

Quality: what you actually lose

Both formats throw information away. That is not a flaw unique to JPG; it is how consumer photo compression works. The extra cost of converting is a second generation: the decoder reconstructs pixels, then the JPG encoder approximates them again.

Practical consequences:

  • Quality is a dial, not a switch. Higher settings retain more detail and grow the file. Lower settings shrink it and soften it.
  • Never chain conversions. Going HEIC to JPG is one generation. Going JPG to JPG repeatedly stacks loss on loss.
  • The source is the archive. If the photo matters, the HEIC stays.

There is a precision trap too. A HEIF can carry 10-bit or deeper samples; a JPG written by a browser converter is 8 bits per channel. If you plan to grade or heavily edit the image later, converting to JPG first discards that headroom permanently.

Compatibility: this is not close

If the question is "where will this file open," the answer is not a nuanced trade-off.

  • Browsers. Only Safari 17 and newer, on Apple platforms, renders HEIC. Chrome, Firefox, Edge and Samsung Internet do not, which means an <img> tag pointing at a .heic file shows a broken image for most of your visitors.
  • Windows. Out of the box, nothing opens it. Microsoft sells an HEVC extension for US$0.99 and gives away a HEIF extension, and you need both.
  • Upload forms and apps. A rejection is usually a MIME-type check, and a JPG passes it.

That asymmetry explains the entire conversion habit. HEIC optimizes storage. JPG optimizes reach. Most people need reach.

Decision rule

Keep the HEIC when the photo never leaves your Apple ecosystem, when disk space is the binding constraint, or when you want the byte-exact file the camera produced.

Make a JPG when you are sending the photo to anyone whose device you do not control, when a form or app demands it, or when your editing software cannot read HEIC.

A reasonable default for most people: keep the originals, and generate JPGs on demand rather than in bulk in advance. The originals cost you storage; converting everything prematurely costs you quality and gives you a folder of duplicates to manage.

Two iPhone settings that prevent the problem

If the recurring annoyance is receiving HEIC rather than making it:

  • Settings > Camera > Formats > Most Compatible switches future captures to JPEG and H.264. Existing photos are unaffected, and new captures grow larger.
  • Settings > Apps > Photos > Keep Originals, when disabled, lets imports into Photos, Image Capture or a PC arrive as JPEG.

And for anything already on disk, browser conversion avoids installing anything:

  1. Drop the files onto the converter, or pick them with the file chooser.
  2. Dial the quality slider (it opens at 90) if you want a smaller result.
  3. Save the JPGs individually, or take the whole batch as a single ZIP.

Metadata behaviour worth noting: capture timestamp and camera details are preserved, GPS coordinates are dropped unless you explicitly enable them, images beyond 16,777,216 pixels are downscaled proportionally with a notice, three conversions run in parallel with files over 20 MiB serialized, and the archive is assembled in memory. One conversion is enough to make the page work offline afterwards.

The one-line version, if you need to explain it to someone else: at quality 90 expect a JPG roughly 1.4 to 1.7 times the size of the HEIC, because the format buys reach with bytes. Treat the HEIC as the negative and the JPG as the print.

I maintain heicly.io, which is the converter these measurements came from. Format facts are drawn from Apple's documentation, the HEIF technical summary, JPEG.org and Can I use browser support data.

Originally published on heicly.io.

Top comments (0)