.pkg

What is a .pkg file?

macOS Installer Package · Disk image · Apple · 2000s

On a Mac, a PKG is an installer package: double-click it and macOS's Installer walks you through setting up the software, copying files and running any needed scripts. The .pkg extension is also reused by other systems for unrelated package data.

Category
Disk image
Type
Binary
Is a .pkg file safe to open? A macOS PKG installs software and can run scripts with elevated privileges, so only open packages from the developer or a source you trust.

What is a .pkg file used for?

A macOS flat package is a xar archive holding the files to install plus scripts, which the Installer app runs. It is used when a simple drag-to-Applications DMG is not enough, for example when system files or background components are involved.

To install one, double-click and follow the steps. To look inside without installing, tools like Pacifist or the xar command can list and extract the contents.

Be aware the .pkg name is not exclusive to macOS; some games and other software use it for their own data packages, so context tells you which kind you have.

How to open a .pkg file

The .pkg format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.

Windows

  • Not applicable for macOS packages

macOS

  • Double-click to install
  • Pacifist (to inspect)
  • xar (command line)

Linux

  • xar (to inspect, for macOS packages)

Web

  • Not applicable

How to convert a .pkg file

You can convert a .pkg file to Not convertible using a conversion tool or the export menu of an app that opens it.

.pkg file signature (magic bytes)

Programs recognise a .pkg file by the bytes at the start of the file, not by its name. These are the signatures for PKG.

Hex signatureOffsetNote
78 61 72 210'xar!' (a macOS flat package is a xar archive); the .pkg name is also reused by other systems for unrelated data

See the full magic-numbers reference for every format.

Frequently asked questions

What is a .pkg file?

On a Mac, a PKG is an installer package: double-click it and macOS's Installer walks you through setting up the software, copying files and running any needed scripts. The .pkg extension is also reused by other systems for unrelated package data.

How do I open or install a PKG file on a Mac?

Double-click it and follow the Installer prompts. To inspect one without installing, open it in the free Pacifist, which can also extract individual files.

Is a .pkg file safe?

A macOS installer package can change your system and run scripts, so only run ones from the official developer. If macOS warns that a package is from an unidentified developer, stop unless you are certain of the source.

Related formats

Sources

Details on this page were checked against authoritative references: