Convert HEIC to JPG via Command Line

A developer's guide to converting HEIC images to JPG from the terminal. Covers heif-convert, ImageMagick, FFmpeg, Python, macOS sips, and PowerShell — with install instructions, batch processing scripts, and a comparison of every tool.

Convert HEIC to JPG

Upload your HEIC file — get JPG instantly

HEIC JPG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Encrypted upload via HTTPS. Files auto-deleted within 2 hours.

heif-convert (libheif) — The Fastest Native Tool

heif-convert is a command-line utility from the libheif project — the reference implementation of the HEIF/HEIC format. It decodes HEIC files natively without relying on ImageMagick delegates or external codecs. This is the same library that Convertio.com uses on its backend servers for HEIC processing, alongside ImageMagick for post-processing.

Installation

Install libheif tools for your platform:

# Ubuntu / Debian
sudo apt install libheif-examples

# Fedora / RHEL
sudo dnf install libheif-tools

# macOS (Homebrew)
brew install libheif

# Arch Linux
sudo pacman -S libheif

Verify the installation:

heif-convert --version

Basic Conversion

Convert a single file to JPG at quality 92:

heif-convert input.heic output.jpg -q 92

The -q flag sets the JPEG quality (1–100). Quality 92 is the sweet spot — visually identical to the HEIC original while keeping the file size reasonable.

Batch Conversion

Convert every HEIC file in the current directory:

for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    heif-convert "$f" "${f%.*}.jpg" -q 92
done

The [ -e "$f" ] || continue guard handles the case where no files match one of the glob patterns (e.g., no uppercase .HEIC files exist).

Useful Flags

Flag Description
-q <1-100>JPEG output quality. Default varies by build; always specify explicitly.
--with-exifPreserve EXIF metadata (camera model, GPS, date/time) in the output file.
-SExtract all images from multi-image sequences (e.g., Live Photos, burst shots).
-C <value>Set chroma upsampling method: nearest-neighbor, bilinear.

Tip: If your HEIC files come from an iPhone and you need GPS coordinates or camera settings in the JPG output, always include --with-exif. Without it, some builds of heif-convert will silently drop the metadata.

ImageMagick — The Swiss Army Knife

ImageMagick is the most widely installed image processing toolkit on Linux servers. If your system already has it, you may not need anything else — recent versions include libheif as a delegate for HEIC decoding. Convertio.com uses ImageMagick for post-conversion processing (resizing, quality adjustment, metadata handling).

Installation

# Ubuntu / Debian (with HEIC delegate)
sudo apt install imagemagick libheif-dev

# Fedora
sudo dnf install ImageMagick libheif-devel

# macOS
brew install imagemagick

Check that the HEIC delegate is available:

magick identify -list format | grep -i heic

If HEIC appears in the output, ImageMagick can read your files directly.

Single File Conversion

magick convert input.heic -quality 92 output.jpg

Or with ImageMagick 7+, the shorter form:

magick input.heic -quality 92 output.jpg

Batch Conversion

for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    magick "$f" -quality 92 "${f%.*}.jpg"
done

Advanced Options

ImageMagick lets you resize, strip metadata, or adjust colorspace in the same command:

# Convert and resize to max 2048px on the longest side
magick input.heic -quality 92 -resize 2048x2048\> output.jpg

# Convert and strip all metadata
magick input.heic -quality 92 -strip output.jpg

# Convert with specific colorspace
magick input.heic -quality 92 -colorspace sRGB output.jpg

FFmpeg — For Video-Oriented Workflows

FFmpeg is primarily a video tool, but it can decode HEIC files if it was compiled with HEVC support. This is convenient if FFmpeg is already part of your pipeline and you want to avoid installing additional tools.

Installation

# Ubuntu / Debian
sudo apt install ffmpeg

# Fedora
sudo dnf install ffmpeg-free

# macOS
brew install ffmpeg

Conversion

ffmpeg -i input.heic output.jpg

To set JPEG quality (FFmpeg uses a scale of 2–31, where 2 is best):

ffmpeg -i input.heic -q:v 2 output.jpg

Batch Conversion

for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    ffmpeg -i "$f" -q:v 2 "${f%.*}.jpg" -y
done

The -y flag overwrites existing output files without prompting.

Note: FFmpeg's HEIC support depends on how it was compiled. Some Linux distribution packages (e.g., ffmpeg-free on Fedora) may lack HEVC decoding due to patent concerns. If you get a decoder error, use heif-convert or ImageMagick instead.

Python — pillow-heif + Pillow

For developers who need HEIC conversion inside a Python application or script, the pillow-heif library adds HEIC support to Pillow (PIL). This is useful for integrating conversion into data pipelines, web backends, or automation scripts.

Installation

pip install pillow-heif Pillow

Single File Conversion

from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

img = Image.open("input.heic")
img.save("output.jpg", "JPEG", quality=92)

Batch Conversion Script

import os
from pathlib import Path
from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

input_dir = Path("./photos")
output_dir = Path("./converted")
output_dir.mkdir(exist_ok=True)

for heic_file in input_dir.glob("*.heic"):
    img = Image.open(heic_file)
    jpg_path = output_dir / f"{heic_file.stem}.jpg"
    img.save(jpg_path, "JPEG", quality=92)
    print(f"Converted: {heic_file.name} -> {jpg_path.name}")

Preserving EXIF Data

from pillow_heif import register_heif_opener
from PIL import Image

register_heif_opener()

img = Image.open("input.heic")
exif_data = img.info.get("exif", b"")
img.save("output.jpg", "JPEG", quality=92, exif=exif_data)

The exif parameter passes the raw EXIF bytes through to the JPG output, preserving camera settings, GPS coordinates, and timestamps.

macOS Terminal — sips (Built-In)

macOS includes sips (Scriptable Image Processing System) out of the box. It supports HEIC natively because macOS bundles the HEVC codec. No installation required.

Single File Conversion

sips -s format jpeg input.heic --out output.jpg

Batch Conversion

mkdir -p converted
for f in *.heic *.HEIC; do
    [ -e "$f" ] || continue
    sips -s format jpeg "$f" --out "converted/${f%.*}.jpg"
done

Caveat: sips strips most EXIF metadata during format conversion. If you need GPS coordinates or camera settings preserved, use heif-convert --with-exif or ImageMagick on macOS instead. Both are available via Homebrew.

PowerShell (Windows) — ImageMagick Loop

On Windows, ImageMagick provides the most reliable command-line option. Once installed, you can use PowerShell to batch-convert:

Installation

  1. Download the Windows installer from imagemagick.org/script/download.php (choose "Win64 dynamic").
  2. Run the installer and check "Add application directory to your system path".
  3. Open a new PowerShell window and verify: magick --version

Single File

magick convert photo.heic -quality 92 photo.jpg

Batch Conversion

Get-ChildItem *.heic | ForEach-Object {
    magick convert $_.FullName -quality 92 ($_.DirectoryName + "\" + $_.BaseName + ".jpg")
}

This converts every .heic file in the current folder to JPG at quality 92. Original files remain untouched.

Tool Comparison

Tool Platforms Batch Quality Ctrl EXIF Speed*
heif-convert Linux, macOS Yes -q 1-100 --with-exif ~0.3s / file
ImageMagick Linux, macOS, Win Yes -quality By default ~0.5s / file
FFmpeg Linux, macOS, Win Yes -q:v 2-31 By default ~0.6s / file
Python Linux, macOS, Win Yes quality= Manual ~0.8s / file
sips macOS only Yes Limited Strips most ~0.4s / file
PowerShell Windows Yes -quality By default ~0.5s / file

*Approximate times for a 12 MP iPhone photo (4032 × 3024) on modern hardware. Actual speed varies by CPU, disk I/O, and image complexity.

Quality Settings Explained

Different tools use different quality scales. Here is how to get equivalent output across tools:

Target Quality heif-convert / IM FFmpeg (-q:v) Python (Pillow)
Maximum-q 100-q:v 2quality=100
Optimal (Convertio)-q 92-q:v 3quality=92
Good-q 85-q:v 5quality=85
Web-optimized-q 75-q:v 8quality=75

Why quality 92? This is the setting Convertio.com uses in production. At 92, the converted JPG is visually identical to the HEIC original in normal viewing conditions. Going higher (95+) inflates file size by 30–50% with no perceptible improvement. Below 85, compression artifacts become visible in sky gradients and fine textures.

Don't Want the Command Line?

If you would rather skip installing tools, configuring delegates, and writing shell loops — the converter widget at the top of this page does the same thing in your browser. Upload a HEIC file, get a JPG back in seconds. Convertio.com uses heif-convert + ImageMagick on its servers — the same tools covered in this article, already configured and optimized.

Ready to Convert?

Skip the setup — convert HEIC to JPG online in seconds

HEIC JPG

Tap to choose your file

or

Supports M4A, WAV, FLAC, OGG, AAC, WMA, AIFF, OPUS • Max 100 MB

Frequently Asked Questions

The fastest method is heif-convert from the libheif package. Install it with sudo apt install libheif-examples on Ubuntu/Debian or sudo dnf install libheif-tools on Fedora, then run: heif-convert input.heic output.jpg -q 92. It decodes HEIC natively without depending on ImageMagick delegates, processing a typical 12 MP photo in about 0.3 seconds.

Yes. The command is simply ffmpeg -i input.heic output.jpg. For best quality, add -q:v 2. However, FFmpeg's HEIC support depends on how it was compiled — some distribution packages lack HEVC decoding due to patent restrictions. If you get a decoder error, try heif-convert or ImageMagick instead, as they are more reliable for this specific task.

Use a shell loop with heif-convert: for f in *.heic *.HEIC; do heif-convert "$f" "${f%.*}.jpg" -q 92; done. This converts every HEIC file in the current directory to JPG at quality 92. On macOS, you can also use the built-in sips command: for f in *.heic; do sips -s format jpeg "$f" --out "${f%.heic}.jpg"; done. For Python, use a script with pillow-heif and Path.glob to process entire directories.

It depends on the tool. heif-convert preserves EXIF data when you use the --with-exif flag. ImageMagick retains all metadata profiles by default unless you add -strip. FFmpeg also preserves metadata by default. Python with pillow-heif preserves EXIF when you pass the exif parameter to the save method. The exception is macOS sips, which strips most EXIF data during format conversion.

A quality setting of 92 provides an excellent balance between file size and visual fidelity — this is what Convertio.com uses in production. At 92, the converted JPG is visually identical to the HEIC original. Going above 95 increases file size by 30–50% with minimal visible improvement. Below 85, compression artifacts become noticeable in detailed areas like sky gradients and fine textures. For web-optimized images where smaller file size matters more, quality 75 is a reasonable lower bound.

More HEIC to JPG Guides

How to Convert HEIC to JPG on Windows 10/11
Convert HEIC to JPG on Windows 10 and 11. Free online converter, HEIF extensions, Photos app, and PowerShell methods.
How to Convert HEIC to JPG on Mac
5 ways to convert HEIC to JPG on Mac: online converter, Preview, Finder Quick Actions, Automator, and Terminal sips.
How to Make iPhone Save Photos as JPG Instead of HEIC
Change iPhone camera format from HEIC to JPG. Most Compatible mode, AirDrop auto-conversion, and converting existing photos.
How to Open & Convert HEIC Photos on Android
Open and convert HEIC photos on Android. Convertio in mobile Chrome, Google Photos, and Samsung camera settings.
How to Batch Convert HEIC to JPG
Batch convert HEIC to JPG online or via command line. Mac Finder, PowerShell, and Linux methods for multiple files.
Convert HEIC to JPG from Google Drive & Google Photos
Cloud services store HEIC as-is. Download and convert to JPG from Google Photos, Drive, iCloud, and Dropbox.
What Is HEIC? Complete Guide to Apple's Photo Format
HEIC explained: Apple's HEVC-based image format. 50% smaller than JPEG, 10-bit color, HDR. Compatibility and conversion.
Why iPhone Photos Are HEIC (and How to Change to JPG)
Why Apple switched to HEIC in iOS 11. Change to Most Compatible mode, auto-transfer settings, and batch convert existing photos.
HEIC vs JPG: Which Format Is Better?
HEIC vs JPG compared: file size, quality, 10-bit color, HDR, compatibility. When to keep HEIC and when to convert.
Why HEIC Photos Look Different After Converting (Color Fix Guide)
Fix washed-out colors when converting HEIC to JPG. Display P3 to sRGB color space conversion explained.
HEIC to JPG Quality: Convert Without Losing Quality
JPEG quality levels compared: q=60 vs q=80 vs q=92 vs q=100. File sizes, color profiles, and how to convert HEIC without visible loss.
Back to HEIC to JPG Converter