NumPy Zipped Array Archive
ZIP container bundling multiple named NumPy `.npy` tensor arrays, widely used for embeddings, calibration datasets, and JAX/MLX checkpoints.
Shares PKZIP `50 4B 03 04` magic bytes; disambiguated by inspecting the ZIP Central Directory for `.npy` member entries.
Drop any .npz file (even 100 GB+) to inspect locally
Reads tiny File.slice() header/footer pages in a sandboxed Web Worker · 0 Bytes Uploaded
.npz Magic Bytes & Header Offset Map
PKZIP Local File Header containing .npy member streams
| Byte Offset | Length | Data Type | Field Name | Engineering Description |
|---|---|---|---|---|
| 0x00 - 0x03 | 4 B | uint32_le | zip_lfh_sig | PKZIP signature 0x04034B50 |
| 0x08 - 0x09 | 2 B | uint16_le | compression | 0 = Store (np.savez), 8 = Deflate (np.savez_compressed) |
| 0x1E+ | var | utf8 | member_name | First array entry name ending in .npy |
.npz Security & Polyglot Risk Matrix
Always load with np.load(file, allow_pickle=False) and enforce decompression byte quotas on Deflate-compressed .npz uploads.
Read .npz Header & Metadata Without Heavy Dependencies
import sys, zipfile
with zipfile.ZipFile(sys.argv[1], "r") as zf:
npy_names = [n for n in zf.namelist() if n.endswith(".npy")]
print(f"NPZ arrays ({len(npy_names)}): {npy_names}")Deterministic .npz Sample Files & Edge Cases
minimal-weights.npz
Real np.savez output containing weights.npy (4x8 float32) and bias.npy (8 float32).
curl -fsSL https://fileformat.co/fixtures/v1/npz/minimal-weights.npz -o minimal-weights.npz \
&& echo "5df985f2575c4c4a1f58f21970bd74830b277688976534283c269be2ccfb2637 minimal-weights.npz" | shasum -a 256 -ccheckpoint-deflated.npz
Real np.savez_compressed bundle with float32, float64, and int32 arrays.
curl -fsSL https://fileformat.co/fixtures/v1/npz/checkpoint-deflated.npz -o checkpoint-deflated.npz \
&& echo "1da30aadf475322bd6b9df64d90d6fda4f4e600251c6c542bcca7c2a0d8a39ca checkpoint-deflated.npz" | shasum -a 256 -ctruncated-eocd.npz
Valid PK local headers but missing complete EOCD — np.load on the archive must raise.
curl -fsSL https://fileformat.co/fixtures/v1/npz/truncated-eocd.npz -o truncated-eocd.npz \
&& echo "3d8d77b9c97b839f497301ec2cbfb8fd34e7c19ae6e0f7ddee51c864c7eb05f5 truncated-eocd.npz" | shasum -a 256 -cRelated Specifications & Alternatives
Simple, mmap-friendly binary representation of a single homogeneous dense tensor with an explicit ASCII header dictionary describing dtype, byte order, and shape.
Hugging Face's memory-safe, zero-copy tensor serialization format designed to replace Pickle-based PyTorch checkpoints without arbitrary code execution risks.
Default PyTorch `torch.save()` archive wrapping a Python Pickle instruction stream (`data.pkl`) alongside raw tensor storage files inside a ZIP container.