Skip to content

Convert TAR.GZ to IMG

Extract a TAR.GZ archive or build a filesystem IMG with the correct layout.

Convert TAR.GZ files online

We don’t have a dedicated online converter for TAR.GZ to IMG yet, but you can convert TAR.GZ files online to these and more formats:

Want to convert TAR.GZ to IMG?

Let us know. We pick the conversions to add next by how many people ask for them.

How to convert tar.gz to img file

A device or imaging utility may require an .img disk image while the available download is a compressed .tar.gz archive. The correct operation is either extracting an IMG already stored in the archive or creating a new filesystem image from the extracted files.

What the TAR.GZ format is

.tar.gz combines a TAR archive with Gzip compression. TAR stores multiple files, directories, permissions, and timestamps; Gzip compresses the TAR stream but does not provide a filesystem, partition table, boot sector, or disk layout.

Linux and Unix systems commonly use TAR.GZ for source distributions, software packages, backups, and collections of files. A TAR.GZ file is not automatically a bootable disk image.

What the IMG format is

In the Archives category, .img generally identifies a disk or filesystem image. It may represent a floppy disk, partition, removable drive, or complete storage device, including filesystem metadata and, in some cases, a partition table and boot code.

Imaging software can write an IMG sector by sector to a memory card or drive, mount it as a filesystem, or restore it as a backup. IMG has no single universal internal specification: compatibility depends on the filesystem, image size, partition scheme, boot requirements, and whether the program expects a raw image or a vendor-specific container.

Check whether the archive already contains an IMG

Inspect the archive before rebuilding anything. On Linux or macOS, list its contents with:

tar -tzf package.tar.gz

On Windows, open the file with 7-Zip or PeaZip. If it contains an .img, extract that file; this is extraction rather than conversion:

tar -xzf package.tar.gz

Do not rename package.tar.gz to package.img. Changing the extension does not change the file structure. Write the extracted image with a tool that explicitly supports raw disk images, such as Raspberry Pi Imager, Fedora Media Writer, or balenaEtcher, only after confirming that the image matches the target device.

Create an IMG from ordinary files

If the archive contains directories and files rather than a complete image, choose the required filesystem and image size first. The following Linux example creates a 1 GiB raw ext4 filesystem image:

mkdir extracted
 tar -xzf package.tar.gz -C extracted
truncate -s 1G disk.img
mkfs.ext4 -F disk.img
mkdir image-mount
sudo mount -o loop disk.img image-mount
sudo cp -a extracted/. image-mount/
sync
sudo umount image-mount

Replace 1G with enough space for the extracted data, filesystem metadata, and future files. This produces a filesystem image, not a partitioned or bootable device image. Check it with file disk.img and mount it read-only for inspection before distributing it.

On macOS, extract the archive with tar -xzf package.tar.gz, then create a mountable read/write image from the directory:

hdiutil create -srcfolder extracted -fs HFS+ -format UDRW -o disk

This normally creates disk.dmg, a macOS disk-image container. Rename it to .img only if the receiving program accepts that container; an extension change does not make it a raw image. For a raw filesystem image required by a specific device, create it with the device vendor's documented tools or use a Linux environment such as a virtual machine or WSL.

On Windows, use 7-Zip or PeaZip to extract the archive, then use WSL or a disk-image authoring utility that explicitly supports creating the required filesystem image. ImDisk can mount or create virtual disks for some workflows, but it does not infer the correct filesystem, partition table, or bootloader.

Online converters and desktop tools

For a non-sensitive archive, services such as CloudConvert or Convertio can be used for archive extraction when their current service page explicitly lists TAR.GZ support. Download the extracted files and create the IMG locally; online services generally cannot infer the target filesystem or boot layout and should not be trusted to produce a device-ready image. Avoid uploading proprietary backups, credentials, or personal data.

7-Zip and PeaZip are suitable desktop extractors. Linux tar, mkfs, loop mounting, and file-copy tools provide direct control over a newly created filesystem image; macOS hdiutil creates mountable macOS disk-image containers.

Compatibility and quality limits

A TAR.GZ archive does not specify the target IMG's capacity, filesystem, partition table, bootloader, device geometry, or boot configuration. Copying its files into an ext4 image will not create a bootable USB drive, Raspberry Pi card, or operating-system installer unless the required partition and boot structures are also created.

For bootable media, obtain the manufacturer's IMG whenever possible. If the TAR.GZ contains a complete image, extract it instead of rebuilding it; rebuilding can lose boot sectors, partition identifiers, sparse regions, filesystem metadata, ownership, and extended attributes. Verify the result with the publisher's checksum, or generate one locally with sha256sum disk.img on Linux or shasum -a 256 disk.img on macOS.

Information about file extensions and file types is provided by File-Extensions.org

Frequently asked questions

Does converting TAR.GZ to IMG make a bootable disk image?

No, not by itself; it extracts the archive into an image, but boot records, partition tables, filesystem metadata, and the expected directory layout must also be created. The result is bootable only if the target device or system expects that complete layout.

Will my TAR.GZ files and permissions be preserved in the IMG?

The files can be preserved, but permissions, ownership, symbolic links, timestamps, and other metadata depend on the filesystem used inside the IMG. Metadata that the target filesystem cannot represent may be changed or lost.

Why is my TAR.GZ to IMG image empty or not mounting?

An IMG is not just another archive, so it must contain a valid filesystem before the extracted files are copied into it. The problem usually occurs when the image has no filesystem, uses an unsupported filesystem, or the files were placed at the wrong level of the required layout.

Will the IMG be smaller than the TAR.GZ archive?

Not necessarily; TAR.GZ is gzip-compressed, while an IMG is often an uncompressed filesystem or disk image. Its size depends on the image capacity, filesystem overhead, unused space, and whether the image is sparse or compressed.

Additional formats for
tar.gz file conversion

Reverse conversion

Convert to img from
other formats

Share on social media:

Already downloaded

This file has already been downloaded. For your privacy it was deleted from our server right after the download, so it cannot be downloaded again. To get it once more, convert the file again.