How to Use macOS SIPS to Batch & Automatically Convert HEIC Files to JPG

While there are many ways to convert HEIC to JPG, the SIPS tool that’s built into macOS offers some useful benefits when it comes to batch processing and automatically converting from watched folders.

Text & Photos By David Coleman
Last Revised & Updated:

I MAY get commissions for purchases made through links in this post.

There are multiple ways to convert HEIC image files to JPGs. Here’s a quick, efficient, and free method of converting HEIC to JPEGs on Mac that’s especially well suited to large batches of images.

HEIC image files are becoming more common, mostly because it has been the default photo file format on the last few generations of iPhones.

As much as HEIC contained useful next-generation features that simply aren’t possible with JPG, it’s still nowhere near as widely compatible as JPG. So there’s still a fairly strong risk that if you try to send a HEIC file to someone else or upload it to some kind of online service that they might not be able to open it.

To avoid that, you can easily convert HEIC to JPG before sending or uploading.

Macs have some pretty neat image-editing tools built into the operating system. Some are obvious, like the default image viewer Preview or the Photos app. I also find Automator very useful for image manipulation tasks that I need to run often.

But there are also some less obvious but powerful tools that are especially useful for repeating common tasks or working with large batches of image files.

The one I’m focusing on here is called SIPS, and it often flies well under the radar. For a long time, I didn’t even know it was there. But since discovering it, I’ve found it to be a very useful addition in my photography and web workflows.

While I have a bunch of image editing apps on my Mac, sometimes it can be quicker, easier, and cleaner to use a tool like this, especially when working with a lot of images at once.

What is SIPS?

SIPS stands for (Scriptable Image Processing System). It’s a command-line tool that you use through Terminal. And while it doesn’t come with a graphical user interface, with some basic commands, you can get some common image tasks done quickly and efficiently.

Even better: it doesn’t require downloading or installing an app. If you use a Mac, it’s already there, baked directly into macOS.

I’m putting together some step-by-step guides to using SIPS for common image tasks that photographers run into. The task I’m focusing on here is converting HEIC files to JPEG, especially large batches of them.

Open Terminal

  1. Open the Terminal application (you can find it in Applications > Utilities or search for it using Spotlight with Command + Space). Or you can navigate to the folder with the images in Finder, then Right-click (or CTRL-click) on the folder containing the images in Finder. Choose Services > New Terminal at Folder.

How to Convert Individual HEIC Files to JPEG Using SIPS

To keep things simple, I’ll start with the core commands on individual images. We’ll then build up in complexity to batch processing of nested folders.

Convert a Single HEIC to JPEG

The command for converting a single HEIC file to a JPEG format is straightforward.

sips -s format jpeg imagefile.heic --out imagefile.jpg

Replace: imagefile.heic with the name of your HEIC file.

Replace: imagefile.jpg with the desired new file name for the JPEG.

Batch Convert HEIC Files to JPEG

You can also use sips to batch convert HEIC files to JPEG by using a wildcard (*) or by scripting a loop to process multiple files.

for file in *.heic; do sips -s format jpeg "$file" --out "${file%.heic}.jpg"; done

This will process all .heic files in the current directory, converting them to JPEG format and saving them in the JPG directory with the same filenames (but with the .jpg extension).

Here’s an example of converting all HEIC images in a folder to JPEG format and then saving the output as new files in a separate subfolder called JPG (NB: make sure to create the subfolder before running the script; it won’t be created automatically):

for file in *.heic; do sips -s format jpeg "$file" --out "JPG/${file%.heic}.jpg"; done

Remember to replace JPG with the directory name you want, and adjust the file extension if you’re working with another file type.

If you want a version that will check for the existing of the subfolder and create it if it doesn’t exist, you can use this:

for file in *.heic; do
  mkdir -p "$outdir"
  sips -s format jpeg "$file" --out "$outdir/${file%.heic}.jpg"

You can change outdir="JPG" line to whatever you want to name the subdirectory. As an example, you might prefer to use outdir="output".

How to Process Folders Recursively

If you’re dealing with a nested folder structure containing images in various subfolders, you can use SIPS to recursively convert these HEIC images to JPEG format.

The trick is to combine it with the find command, which can traverse directory trees to apply actions to files that match certain criteria.

Here’s how to do it:

Convert HEIC Images Recursively

To convert all HEIC images in the current directory and all subdirectories to JPEG format, you can use the following command:

find . -iname '*.heic' -exec sips -s format jpeg '{}' --out '{}'.jpg \;

This will create a new JPG version of each file directly alongside the original HEIC version.

Save Output While Preserving Folder Structure

If you prefer to have the new JPEGs in a separate directory while preserving the original directory structure, you can use this:

mkdir -p "$jpeg_base_dir"
find . -iname '*.heic' | while read -r heic_file; do
  mkdir -p "$(dirname "$jpeg_file_path")"
  sips -s format jpeg "$heic_file" --out "$jpeg_file_path"

That will create a subdirectory called Converted_to_JPEG and then output the files in corresponding subfolders underneath that.

(You can also create a variation of this by saving it as a script file and calling that script file in the command.)

Using a Watched Folder for Automatic Conversion

It’s possible to take this a step further and create a watched folder that automatically converts any HEIC images added to it to JPG. In this version, it will also automatically delete the HEIC versions and send them to Trash.

To make this work, you can use Folder Actions with an attached AppleScript (or, alternatively, something like Hazel).

Here’s how you can set it up:

Step 1: Write an AppleScript

  • Open the Script Editor app on your Mac (located in the /Applications/Utilities/ folder). You can also use any standard text editor or code editor such as Sublime; the key step is in using the .scpt file extension when saving it.
  • Copy & paste the following AppleScript:
on adding folder items to this_folder after receiving added_items
    tell application "Finder"
        repeat with anItem in added_items
            set theItemPath to the POSIX path of anItem
            if theItemPath ends with ".HEIC" or theItemPath ends with ".heic" then
                set jpgPath to (text 1 thru -6 of theItemPath) & ".jpg"
                do shell script "/usr/bin/sips -s format jpeg " & quoted form of theItemPath & " --out " & quoted form of jpgPath
                move anItem to the trash
            end if
        end repeat
    end tell
end adding folder items to
  • Save the file. You can name it anything you like (descriptive is good), and it should have the file extension .scpt. So, as an example, I’m going to called mine “ConvertHEICToJPEG.scpt”.
  • In theory, you should be able to save it in a convenient place, but I had some trouble with it now showing up if I didn’t save it in the default scripts folder. So I’ve just been saving them directly there (~/Library/Scripts/Folder Action Scripts/).

This script will convert all HEIC files added to the watched folder into JPG format and then move the original HEIC files to Trash (you can recover them from there if need be).

Step 2: Set Up Folder Actions

  • Right-click on the folder you want to watch and select “Services” > “Folder Actions Setup…”
  1. In the Folder Actions Setup window, choose the folder you want to attach the action to.
  2. Click the “+” button under “Folder Actions” to attach a new action.
  3. Choose the script you just saved and click “Attach.”
  4. Make sure that Folder Actions is enabled (there should be a check next to the folder and the script).
  5. To test that it’s working as expected, drag a HEIC image (or multiple images) into your watched folder. The script should automatically convert the image to a JPG format and remove the original HEIC file.

Things Worth Knowing

  • The script and Folder Actions will only work when your Mac is awake and logged in. If the Mac is sleeping or logged off, the Folder Actions won’t be triggered until the next login. That might be a consideration for network folders or those on a sync service.
  • SIPS is quite efficient at working with large batches of image files, and I routinely apply it to thousands of images at once. But if you’re running into issues or working with an especially large number of files, it can be useful to break them up into batches by using a few image folders instead of a single folder.

Converting Other Image Formats with SIPS

I’ve been focusing on converting HEIC to JPG here, because that’s a fairly common task these days. But the same commands, modified accordingly, can be used for other image formats that SIPS supports. That’s not a super-long list, and there are plenty of formats that you can’t convert this way, but any of these should be natively supported in your version of macOS.

  • JPEG (.jpg, .jpeg)
  • Joint Photographic Experts Group (JPEG-2000) format (.jp2)
  • Tagged Image File Format (TIFF) (.tiff, .tif)
  • Graphic Interchange Format (GIF) (.gif)
  • Portable Network Graphics (PNG) (.png)
  • Portable Document Format (PDF) (.pdf) – Note that this is for images in PDF format, not multi-page text documents.
  • Bitmap format (.bmp)
  • Photoshop format (.psd)
  • OpenEXR format (.exr)
  • SGI format (.sgi)
  • TGA format (.tga)

For other, and especially newer formats, like WebP or AVIF, you can use even more powerful tools like ImageMagick (stay tuned; I have a guide on that in the works).

And this is not a suitable way to process RAW files; in that case, processing is a much more sophisticated undertaking than run-of-the-mill file format conversion.

Terminal Basics: Navigating to the Image Folder

This isn’t the place for dealing with the ins and outs of Terminal. But Apple has put together a useful Terminal User Guide that is a very good place to start.

However, there is one type of Terminal function that’s especially relevant and useful here. And that involves navigating to the folder that holds the image files. The commands above assume that the images are all in a single flat folder. So it’s much easier and simpler if you can navigate to that folder from the get-go.

There are multiple ways to do that. Some of the easiest are:

Terminal Command

In Terminal, use the cd (change directory) command to navigate to the desired directory. For example: cd /path/to/your/folder.

Hybrid Finder/Terminal Command

In the terminal console, type cd (with a space after it) and then drag and drop the folder from Finder into the Terminal window. Press Enter.

Services Menu

This is enabled by default in macOS, but if you don’t see it, you might need to enable it first (more on that below).

Right-click (or CTRL-click) on the folder containing the images in Finder. Choose Services > New Terminal at Folder.

If you don’t see that in the list of available services, you can enable it in System Preferences > Keyboard > Shortcuts > Services and then make sure that New Terminal at Folder is checked.

Assign a Keyboard Shortcut

If it’s something you need to do often, you can combine the Services with a custom keyboard shortcut. You can assign that through System Preferences > Keyboard > Shortcuts > Services. Find the service called New Terminal at Folder, double-click on none and then press whatever key combination you want to use.

Profile photo of David Coleman | Have Camera Will Travel | Washington DC-based Professional Photographer

Text & Photos by David Coleman

I'm a professional photographer based in Washington DC. Seven continents, up mountains, underwater, and a bunch of places in between. I've been shooting for 30+ years, and my my photos and time-lapse videos have appeared in a bunch of different publications from major newspapers to magazines and books, billboards, TV shows, professional sports stadiums, museums, and even massive architectural scrims covering world-famous buildings while they're being renovated. You can see some of my travel photography here and here.

Leave a Comment