{
  "schemaVersion": 1,
  "contentVersion": "ca42e61ede0a24f789d7287a0001244ad22f4abf",
  "id": "docs/codecs/data/7z",
  "collection": "docs",
  "title": "7z",
  "description": "7z is the 7-Zip archive format: LZMA2 solid archives with strong compression, AES-256 encryption and big dictionaries, readable by 7-Zip and many other tools.",
  "canonicalUrl": "https://encode.wiki/codecs/data/7z/",
  "apiUrl": "https://encode.wiki/api/v1/documents/docs/codecs/data/7z.json",
  "markdownUrl": "https://encode.wiki/api/v1/markdown/docs/codecs/data/7z.md",
  "status": "current",
  "tags": [
    "migrated"
  ],
  "license": "CC BY-SA 4.0",
  "dates": {
    "lastVerified": "2026-10-08T00:00:00.000Z"
  },
  "authors": [],
  "sources": [
    {
      "title": "7-Zip",
      "url": "https://7-zip.org/7z.html",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    },
    {
      "title": "7-Zip release history",
      "url": "https://7-zip.org/history.txt",
      "accessedAt": "2026-10-08T00:00:00.000Z"
    }
  ],
  "provenance": {
    "originUrl": "https://github.com/av1-community-contributors/codec-wiki/blob/37c3317fd058b23c71a87679bed5619a98f77752/docs/data/7z.mdx",
    "originCommit": "37c3317fd058b23c71a87679bed5619a98f77752",
    "migratedAt": "2026-08-21T00:00:00.000Z",
    "modified": true,
    "originPath": "docs/data/7z.mdx"
  },
  "headings": [
    {
      "depth": 2,
      "text": "Install",
      "anchor": "install"
    },
    {
      "depth": 2,
      "text": "Common commands",
      "anchor": "common-commands"
    },
    {
      "depth": 2,
      "text": "Pitfalls",
      "anchor": "pitfalls"
    }
  ],
  "sections": [
    {
      "id": "_preamble",
      "title": "Page introduction",
      "depth": 0,
      "canonicalUrl": "https://encode.wiki/codecs/data/7z/",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/_preamble.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/_preamble.md",
      "checksum": "30365cfbe35ac2abb970e898b6ae4d2c64474995586084ff1d149e13c7f43562",
      "bytes": 689
    },
    {
      "id": "install",
      "title": "Install",
      "depth": 2,
      "anchor": "install",
      "canonicalUrl": "https://encode.wiki/codecs/data/7z/#install",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/install.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/install.md",
      "checksum": "1479d91e13cdc3bec7734198325af5e6c0d24b294f52ca260f8b72607349f1dd",
      "bytes": 204
    },
    {
      "id": "common-commands",
      "title": "Common commands",
      "depth": 2,
      "anchor": "common-commands",
      "canonicalUrl": "https://encode.wiki/codecs/data/7z/#common-commands",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/common-commands.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/common-commands.md",
      "checksum": "61df7fff698939d80d4d3dbf2a6b05301d438d7598e0b2ed21e1eae29409e5ad",
      "bytes": 1727
    },
    {
      "id": "pitfalls",
      "title": "Pitfalls",
      "depth": 2,
      "anchor": "pitfalls",
      "canonicalUrl": "https://encode.wiki/codecs/data/7z/#pitfalls",
      "apiUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/pitfalls.json",
      "markdownUrl": "https://encode.wiki/api/v1/sections/docs/codecs/data/7z/pitfalls.md",
      "checksum": "fa8ade31e3b80fb5d265d59a10079082beb829a3837dc2a12cf563038658afb1",
      "bytes": 791
    }
  ],
  "outboundReferences": [
    "/codecs/data/tar/",
    "/codecs/data/xz/",
    "/codecs/data/zip/",
    "https://7-zip.org/"
  ],
  "checksum": "c99de4744622b3edb7f8b598ef8f49982876144c22fcd20457b25fe1660cfc31",
  "contentFormat": "markdown",
  "markdown": "7z is the native format of [7-Zip](https://7-zip.org/), Igor Pavlov's open-source archiver. It uses LZMA2 (the algorithm behind [xz](/codecs/data/xz/)) with large dictionaries, and by default compresses all files together as one **solid** block, so similar files share context. For collections of many similar files, it is typically the smallest common archive format, well ahead of [ZIP](/codecs/data/zip/). It also does AES-256 encryption (including file names) and applies filters that help executables and some binary data.\n\n7-Zip is also a general archive reader: it opens ZIP, tar, gz, xz, bz2, RAR, ISO, WIM, disk images and many others, and since 24.01 it can unpack `.zst` files.\n\n## Install\n\nOn Windows use the 7-Zip installer. On Linux, use your distribution's `7zip` package or the official `7zz` build from 7-zip.org; the old `p7zip` is unmaintained. The command is `7z` or `7zz`.\n\n## Common commands\n\n```sh\n7z a archive.7z dir/                  # create (LZMA2, level 5)\n7z a -mx=9 archive.7z dir/            # maximum compression\n7z a -mx=9 -md=256m archive.7z dir/  # bigger dictionary\n7z x archive.7z -oout/                # extract with paths into out/\n7z l archive.7z                       # list\n7z t archive.7z                       # test\n7z a -p -mhe=on secret.7z dir/        # AES-256, encrypt file names too (prompts for password)\n```\n\nThe options that matter:\n\n| Switch                                       | Effect                                                                                           |\n| -------------------------------------------- | ------------------------------------------------------------------------------------------------ |\n| `-mx=0…9`                                    | Level; default 5. 9 is \"ultra\"                                                                   |\n| `-md=Nm`                                     | LZMA2 dictionary size; bigger finds more repeats but needs that much RAM to compress and extract |\n| `-ms=on`                                     | Solid archive (default); `-ms=off` allows fast extraction of single files at a worse ratio       |\n| `-mmt=N`                                     | Thread count; all cores by default                                                               |\n| `-mhe=on`                                    | Encrypt file names as well as data (needs a password)                                            |\n| `-t7z`, `-tzip`, `-txz`, `-tbzip2`, `-tgzip` | Output format                                                                                    |\n\nUse `-bso0 -bsp0` to silence output in scripts.\n\n## Pitfalls\n\n- **Solid archives are slow to extract from.** Pulling one file out of a solid 7z means decoding everything before it in the same block. Use `-ms=off` or smaller solid blocks (`-ms=100m`) when you need random access.\n- **Not for Unix backups.** 7z does not preserve Unix owner/group, ACLs or extended attributes, so use [tar](/codecs/data/tar/) with xz or zstd for system backups and preserve permissions.\n- **No recovery data.** A damaged 7z can often be partly extracted, but there is no built-in repair; keep a second copy or use PAR2.\n- **Compatibility:** not built into macOS or most Linux file managers without a 7-Zip/p7zip install. Choose ZIP for strangers.\n- **Large dictionaries** require the same memory on extraction; `-md=1536m` archives can fail on small devices.\n"
}
