.PKG

PKG File

macOS Installer Package
Ask a question
QUICK ANSWER

A PKG file is a macOS Installer package - it installs software on a Mac. Double-click it to run Apple's Installer app, which will walk you through setup (admin password usually required). Before running any PKG from outside the App Store, inspect it with the free Suspicious Package app to see exactly what it will install and which scripts it will run.

Developer: Apple Category: System Files Open standard MIME: application/x-xar
OPENS ON Windows macOS Linux
Related: .NOMEDIA · .DLL · .TMP · .LNK

On this page

19k+ extensions indexed
Last reviewed Aug 26, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the PKG file format?

The .pkg extension is used, among others, within the macOS operating system, developed by Apple. .pkg files contain packages of compressed installer files with the XAR internal format, whose purpose is to install an application on Mac computers. .pkg files are actually XAR archives with a different extension and a strictly defined hierarchy of files: a Table of Contents in XML, a compressed CPIO payload carrying application files, and optional install scripts.

The aim of the XAR project is to create an easily expandable archive format, and this makes .pkg a flexible delivery vehicle for macOS software. While developing the .pkg format, the main aim was to create a mechanism that would facilitate work during the installation process - and this priority has been achieved. Installation and updating using .pkg files can be performed easily through the built-in macOS Installer app or the installer command in Terminal. Installation of software can be performed individually, or along with a pre- or post-install script responsible for such a process.

The current flat .pkg format was introduced in Mac OS X 10.5 Leopard (2007). Modern packages must be signed with an Apple Developer certificate and notarized for distribution outside the Mac App Store.

.pkg files are currently used as listed below:

  • as installation packages in Apple systems - both on computers running macOS and on iPhones (distributed via MDM or Apple Configurator)
  • by Sony, for installing software and applications on PlayStation 3, PlayStation 4, and PlayStation 5 consoles
  • historically by Symbian systems to hold configuration information within installation packages

Related formats include .DMG disk images used for app distribution, .MPKG meta-packages that bundle multiple .pkg installers, and .XIP signed archives used by Xcode.

Security & safety

RISK: MEDIUM

A macOS .pkg can run preinstall/postinstall scripts with elevated privileges, so it is more dangerous than a drag-to-Applications app - malware and adware have been distributed as .pkg installers. Only run packages from trusted sources; macOS Gatekeeper warns about unsigned/non-notarized packages, and you should heed that. Inspect anything uncertain with Suspicious Package (it shows the scripts and the signer) before installing.

Format details

in a nutshell
FULL NAMEmacOS Installer Package
DEVELOPERApplesince macOS flat .pkg (XAR-based) since Mac OS X 10.5 Leopard (2007); earlier bundle .pkg since NeXTSTEP/Mac OS X 10.0
CATEGORYSystem Files
MIME TYPEapplication/x-xar
TYPEXAR archive containing payload, Bill of Materials and install scripts (binary)
STANDARDOpen · royalty-free
This extension is also used by…
  • PlayStation Package - Encrypted, console-specific game/DLC/update package for PS3/PS4/PS5/Vita; installs only on the matching console, not a computer.
  • Symbian Installer Script (.pkg) - Obsolete text build script used by old Symbian/Nokia SIS packaging.
  • Apple Newton Package - Rare, obsolete package format for the discontinued Apple Newton platform (the old DB name for this extension).
MAGIC BYTES · FILE SIGNATURE
OFFSET
00010203
HEX
78617221
ASCII
xar!
A modern macOS flat .pkg is a XAR archive: bytes "xar!" (78 61 72 21) at offset 0. Older macOS .pkg are bundles (folders, no single signature).

Programs that open PKG files

Windows1 app
7-Zip Open-source Open a macOS .pkg as a XAR archive to extract its contents - you can read files but CANNOT install Mac software on Windows.
macOS4 apps
Installer (built-in) Built-in Double-click the .pkg; Apple's Installer app guides you through installation (may ask for your admin password).
Suspicious Package Free Open the .pkg to inspect every file, script and the signer/notarization BEFORE installing - includes a Quick Look preview.
Pacifist Paid Open the .pkg to browse and extract individual files/apps without running the full installer.
installer (Terminal) Built-in Run 'sudo installer -pkg file.pkg -target /' to install from the command line (for scripts/automation).
Linux1 app
xar / cpio (command line) Open-source Run 'xar -xf file.pkg' then unpack the Payload (gzip|cpio) to extract files - for inspection only, not installation.

Technical details

deep spec
Internal formatXAR (eXtensible ARchive) binary archive
Magic bytes`78 61 72 21` (`xar!`) at file offset 0; identifies a modern flat package - older bundle packages are directories with no single file signature
MIME type`application/x-xar`
Table of ContentsXML document stored uncompressed inside the XAR header, indexing every file's checksum, compression method, and metadata
Payload formatCPIO archive compressed with gzip, bzip2, or lzma inside the XAR container
Bill of Materials`Bom` file inside the package listing installed paths, file owners, permissions, and sizes
Install scripts`preinstall` and `postinstall` shell scripts executed as root before and after payload installation
Code signingSigned with an Apple Developer ID Installer certificate; signature verified by macOS Gatekeeper on launch
NotarizationApple notarization required for packages distributed outside the Mac App Store on macOS 10.15 and later
Package variantsFlat `.pkg` is a single XAR file; legacy bundle `.pkg` (pre-10.5) is a directory structure - both share the same extension
Command-line install`sudo installer -pkg file.pkg -target /`
Extraction without install`xar -xf file.pkg` unpacks the archive to the current directory without running install scripts
Distribution XMLOptional `Distribution` file at the root of a product archive controls multi-choice or multi-package installs with embedded JavaScript logic
Component vs. product archiveA `.pkg` may be a simple component package or a product archive bundling multiple component packages into one installer
ReleasedmacOS flat .pkg (XAR-based) since Mac OS X 10.5 Leopard (2007); earlier bundle .pkg since NeXTSTEP/Mac OS X 10.0
Open standardYes · royalty-free
Specificationgithub.com

PKG conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with PKG files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about PKG files.

Frequently asked questions

How do I open a PKG file on a Mac?
Double-click it - Apple's Installer app runs and walks you through installing the software. To peek inside first, open it with Suspicious Package (free) instead of installing.
How do I open a PKG file on Windows?
A macOS installer .pkg is a XAR archive, so you can extract its contents with 7-Zip to read the files - but you cannot install Mac software on Windows.
Is a PKG file safe to install?
Only if the source is trustworthy. macOS packages can run privileged install scripts, so prefer signed/notarized packages and inspect uncertain ones with Suspicious Package before running.
How can I see what a PKG will install before running it?
Open it in Suspicious Package (free) to view every file, the install scripts and the signer, or use Pacifist to browse and extract contents without installing.
macOS says the package is 'damaged' or from an 'unidentified developer' - what do I do?
That's Gatekeeper blocking an unsigned/non-notarized package. Re-download from the official source; only if you fully trust it, right-click > Open (or allow it in System Settings > Privacy & Security).

References

1Apple - Distributing software with Installer / flat package formatdeveloper.apple.com
2XAR archive format (Apple OSS)github.com

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.CRDOWNLOADChrome Partial Download File
3.PARTPartial Download File
4.DATProgram Data File (generic)
5.EXEWindows Executable (Portable Executable)
6.BINCD/DVD Disc Image (BIN/CUE)
7.NOMEDIAAndroid No-Media Marker File
8.RPMSGRestricted Permission Message
9.MDMarkdown Document
10.TMPTemporary File

Related extensions

.NOMEDIAAndroid No-Media Marker File
.DLLDynamic Link Library
.TMPTemporary File
.LNKWindows Shell Link (Shortcut)
.ETLEvent Trace Log
.ASECAndroid Secure Encrypted Container (apps-on-SD container)

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z