Convert HEIC photos to JPEG with a single command. No installation required.
A fast, simple command-line tool to convert HEIC images to JPEG format while preserving EXIF metadata.
# Convert all HEIC files in current directory
heic2jpg
# Convert a specific directory
heic2jpg photos/
# Convert recursively with custom output
heic2jpg -r --output ./converted photos/- 🚀 Fast conversion - Efficiently converts HEIC images to high-quality JPEG
- 📸 EXIF preservation - Maintains photo metadata (date, location, camera settings)
- 🎯 Flexible naming - Supports custom output patterns with placeholders
- 📁 Batch processing - Convert entire directories at once
- 🔍 Dry-run mode - Preview conversions before executing
- 💻 Cross-platform - Works on macOS, Linux, and Windows
Go to the Releases page and download the binary for your platform:
| Platform | File |
|---|---|
| macOS (Apple Silicon) | heic2jpg-darwin-arm64 |
| macOS (Intel) | heic2jpg-darwin-amd64 |
| Linux | heic2jpg-linux-amd64 |
| Windows | heic2jpg-windows-amd64.exe |
Install on macOS/Linux:
chmod +x heic2jpg-*
sudo mv heic2jpg-* /usr/local/bin/heic2jpgInstall on Windows:
- Download
heic2jpg-windows-amd64.exefrom the Releases page - Rename it to
heic2jpg.exe(optional, for easier typing) - Move it to a folder like
C:\Tools\ - Add that folder to your PATH:
- Press
Win + R, typesysdm.cpl, press Enter - Go to Advanced → Environment Variables
- Under "User variables", select Path → Edit → New
- Add
C:\Tools(or wherever you put the file) - Click OK on all windows
- Press
- Open a new Command Prompt and type
heic2jpgto verify it works
Requirements: Go 1.21+, C compiler
git clone https://github.com/yishaym/heic2jpg.git
cd heic2jpg
make buildThe binary will be in the dist/ directory.
Install the binary:
# macOS/Linux
chmod +x dist/heic2jpg-*
sudo mv dist/heic2jpg-* /usr/local/bin/heic2jpg
# Or add to your PATH
export PATH=$PATH:$(pwd)/distConvert all HEIC files in the current directory:
heic2jpgConvert all HEIC files in a specific directory:
heic2jpg /path/to/photosConvert a single file:
heic2jpg photo.heicCustom output directory:
heic2jpg --output ./converted photos/Custom naming pattern:
# Add suffix to original names
heic2jpg --pattern "{name}_converted"
# Sequential numbering
heic2jpg --pattern "IMG_{index}"
# Include date in filename
heic2jpg --pattern "{date}_{name}"Recursive directory scanning:
heic2jpg --recursive photos/
# or use short form
heic2jpg -r photos/Dry-run mode (preview without converting):
heic2jpg --dry-run photos/Skip confirmation prompts:
# Useful for automation or when processing many files
heic2jpg --yes photos/
# or use short form
heic2jpg -y photos/Overwrite existing files:
heic2jpg --force photos/
# or use short form
heic2jpg -f photos/Limit file size:
# Only process files up to 500MB (default)
heic2jpg --max-size 500MB photos/
# Process files up to 1GB
heic2jpg --max-size 1GB photos/
# Disable size limit (use with caution)
heic2jpg --max-size 0 photos/Strict EXIF mode:
# Fail conversion if EXIF metadata is missing
heic2jpg --strict photos/Show version:
heic2jpg --versionThe --pattern flag supports the following placeholders:
{name}- Original filename without extension{date}- File modification date (YYYY-MM-DD format){index}- Sequential number (001, 002, 003...)
Examples:
# Original: IMG_1234.heic → IMG_1234.jpg
heic2jpg --pattern "{name}"
# Original: IMG_1234.heic → IMG_1234_web.jpg
heic2jpg --pattern "{name}_web"
# Original: IMG_1234.heic → 2024-01-15_IMG_1234.jpg
heic2jpg --pattern "{date}_{name}"
# Original: IMG_1234.heic → photo_001.jpg
heic2jpg --pattern "photo_{index}"Convert vacation photos:
heic2jpg --output ~/Pictures/Converted ~/Pictures/Vacation2024/Rename with dates for organization:
heic2jpg --pattern "{date}_{name}" --output ./organized ./photos/Preview before converting:
heic2jpg --dry-run --pattern "IMG_{index}" ./photos/- Image Quality: JPEG encoding at 95% quality
- EXIF Support: Preserves all EXIF metadata from HEIC files
- Dependencies: Uses goheif for HEIC decoding
make buildmake build-allThis attempts to create binaries in the dist/ directory for:
- macOS (Intel and Apple Silicon)
- Linux (x86_64)
- Windows (x86_64)
Important Note on Cross-Compilation:
This project uses CGO (via the goheif library which depends on libde265). Cross-compilation with CGO is complex and requires platform-specific C toolchains and libraries.
For production releases, we recommend building natively on each target platform:
- On macOS: Run
make buildto create the macOS binary - On Linux: Run
make buildto create the Linux binary - On Windows: Run
make buildto create the Windows binary
The make build-all target will attempt cross-compilation but will gracefully skip platforms that fail, ensuring at least the native platform builds successfully.
make clean- Ensure the directory contains
.heicor.HEICfiles - Check file permissions - the tool needs read access to the files
- The HEIC file may be corrupted
- Try opening the file in another application to verify it's valid
- Some HEIC variants may not be supported by the underlying library
- Check that you have write permissions to the output directory
- If using
--output, ensure the directory exists or the tool can create it
- Ensure you have a C compiler installed (gcc on Linux, Xcode Command Line Tools on macOS)
- On Linux, you may need to install development libraries:
sudo apt-get install libde265-dev - On macOS, install Xcode Command Line Tools:
xcode-select --install
- Cross-compiling with CGO is complex due to C dependencies
- For best results, build natively on each target platform
- See the "Building" section for platform-specific build instructions
Yes, HEIC is a variant of HEIF. The tool should work with most HEIF images.
Images are encoded at 95% JPEG quality, which provides excellent quality while reducing file size. The conversion is lossy, as JPEG is a lossy format.
Original HEIC files are never modified or deleted. The tool only creates new JPEG files.
No, this tool only converts HEIC → JPEG. Converting JPEG → HEIC would require a different tool.
Yes, all EXIF metadata (including date, location, camera settings) is preserved in the output JPEG files.
Yes! The tool is designed for command-line use and works great in scripts. Use --dry-run to test your commands first.
macOS (Intel and Apple Silicon), Linux (x86_64), and Windows (x86_64). Other platforms may work if you build from source.
MIT License - see LICENSE file for details
Contributions are welcome! Please see CONTRIBUTING.md for details.