XAR & macOS .pkg Magic Bytes (xar!)
eXtensible ARchiver (XAR) is the archive container adopted by Apple for flat macOS Installer packages (.pkg). Every XAR archive starts at byte 0 with the 4-byte ASCII magic xar! (78 61 72 21), followed by header size (usually 00 1C), version (00 01), and a zlib-compressed XML table of contents.
Signature & identification summary
| Detected format name | XAR archive |
|---|---|
| Hexadecimal magic bytes | 78 61 72 21 |
| ASCII / marker preview | xar! |
| Byte offset | 0 |
| MIME type | application/x-xar |
| Common extensions & aliases | .pkg, .xar, .mpkg |
Check whether your file really is XAR / macOS PKG.
Drop any file into File Sniff’s free local browser checker to verify its 78 61 72 21 signature and spot misleading extensions—without uploading a single byte.
Container & byte-layout notes
Inside a macOS .pkg sit Distribution XML, Bom (Bill of Materials), Payload (a gzip/cpio archive of installed files), Scripts (preinstall/postinstall shell scripts) and optional Apple Developer ID X.509 CMS signatures.
Extension mismatches & common pitfalls
Because .pkg installers execute preinstall/postinstall scripts with administrator privileges on Mac, verify code-signing with pkgutil --check-signature before opening any downloaded .pkg.
Which apps open XAR / macOS PKG files?
| Platform | Compatible applications & tools |
|---|---|
| Mac (macOS) | macOS Installer, pkgutil / xar in Terminal, Suspicious Package (for safe inspection) |
| iPhone & iPad | Not executable on iOS/iPadOS |
| Windows | 7-Zip (can inspect XAR contents read-only) |
Free local tools & related guides
- Check whether a file really is XAR / macOS PKG
- Inspect raw bytes in the Hex Viewer
- Guide: How to identify an unknown file type
- Guide: How to Change a File Extension Safely
Inspect files & folders natively
on Mac, iPhone & iPad.
The native File Sniff app scans entire folders, spots extension mismatches, repairs extensions with Undo on Mac, and exports CSV or JSON reports locally.