PKG.pkg

How to Extract Files from a PKG Archive on macOS

PKG files are macOS installer packages used for software that needs system-level installation — drivers, frameworks, system utilities, and enterprise software. While macOS handles PKG installation natively, inspecting the contents of a PKG file before running it is a smart security practice.

The default way to open PKG files on macOS

Tool: Installer.app / pkgutil (built-in)

$ pkgutil --expand package.pkg output_dir

Steps

  1. To install: double-click the .pkg file and follow the installer wizard.
  2. To inspect contents before installing: pkgutil --payload-files package.pkg
  3. To expand the package: pkgutil --expand package.pkg output_dir
  4. To extract payload: cd output_dir && cat Payload | cpio -id
Note: pkgutil can list and expand packages, but the workflow is complex. MacPacker provides a visual browser for PKG contents.

Extract individual files from a PKG archive

The default macOS tools extract everything — there's no way to pick individual files. MacPacker lets you browse PKG archive contents, preview files, and extract only what you need — without unpacking the entire archive.

A better way: open PKG files with MacPacker

MacPacker is a free, open-source macOS archive manager that supports PKG and 30+ other formats. Unlike the default tools, MacPacker lets you:

  • Browse archive contents like a folder
  • Preview files with Quick Look without extracting
  • Extract individual files via drag and drop
  • Navigate nested archives (archives within archives)
  • Enjoy a native SwiftUI interface that feels right at home on macOS

Get MacPacker

v0.15.1 · macOS 14+
$ brew install --cask macpacker

App Store updates may lag a few days behind direct downloads due to Apple review.

Frequently asked questions

How do I inspect a PKG file before installing on Mac?

Use MacPacker to open the .pkg file and browse its contents without installing. From Terminal, run: pkgutil --payload-files package.pkg to list the files it would install.

Can I extract a PKG file without installing it?

Yes. Use MacPacker to browse and extract specific files visually. From Terminal: pkgutil --expand package.pkg output_dir to expand the package structure.

Is it safe to open a PKG file on Mac?

PKG files run installer scripts that can modify your system. Always verify the source. Use MacPacker to inspect PKG contents before installing — you can see exactly what files it contains.

Related formats