Forum Discussion
How do I convert HEIC files to JPEGs in Windows 10?
HEIC is a modern image format used by Apple iPhone, but it's not always compatible with Windows os. If you want to batch convert .heic files to the more universal .jpg format using PowerShell, it's possible. But you'll need Windows 10/11 with HEIF and HEVC extensions installed and access to the Windows.Graphics.Imaging API via PowerShell.
Below is a PowerShell script using Windows Runtime APIs to convert HEIC to JPG in Windows 11/10.
Add-Type -AssemblyName System.Runtime.WindowsRuntime
$null = [Windows.Storage.StorageFile, Windows.Storage, ContentType = WindowsRuntime]
# Source and destination folders
$sourceFolder = "C:\Path\To\HEIC"
$destinationFolder = "C:\Path\To\Output"
# Load all .heic files
$files = Get-ChildItem -Path $sourceFolder -Filter *.heic
foreach ($file in $files) {
$inputPath = Join-Path $sourceFolder $file.Name
$outputPath = Join-Path $destinationFolder ($file.BaseName + ".jpg")
$softwareBitmap = $decoder.GetSoftwareBitmapAsync().GetAwaiter().GetResult()
$outputFile = [Windows.Storage.StorageFile]::CreateStreamedFileAsync(
[System.IO.Path]::GetFileName($outputPath),
{ param($streamOut)
$outStream = $streamOut.AsStreamForWrite()
$encoder = [Windows.Graphics.Imaging.BitmapEncoder]::CreateAsync(
[Windows.Graphics.Imaging.BitmapEncoder]::JpegEncoderId,
$streamOut
).GetAwaiter().GetResult()
},
$null
).GetAwaiter().GetResult()
Write-Host "Converted: $inputPath -> $outputPath"
}
⚠️ Notes:
✅ HEIF Image Extensions and HEVC Video Extensions must be installed from Microsoft Store.
✅ Tested fine on Windows 10 and Windows 1111.
⚠️ This method works only on systems where the Windows Runtime API is available.
❌ Does not work on older versions of Windows or systems without HEIC support. In this case, you need a third-party HEIC to JPEG converter app instead.