Zig fmt
ziglang.org
- Free plan
- Windows
- macOS
- Linux
What Zig fmt is
Zig fmt is the source formatter for Zig, producing a canonical style for Zig code. It uses parsing support from the Zig standard library, and the Zig build system can run it across a codebase or a selected subset. For a non-modifying check, `--check` lists files that do not conform on stdout and exits with an error when any are found. The formatter can also convert invalid source encodings to valid ones, including by removing byte order marks and carriage returns. It is part of the free, open-source Zig toolchain and is available through releases for Windows, macOS, and Linux. The release notes cite editor integrations for Vim and VSCode, and Zig can also be installed from a package manager. Release files are signed with minisign; the download page recommends community mirrors for automated downloads. The Zig language reference is available as a standalone HTML document that works offline.
Who it suits
Zig developers who want consistent formatting, including those running formatting through the Zig build system or checking files without changing them. It also suits teams using Vim or VSCode integrations.
Good to know, and what to watch
- Formats Zig code to a canonical style.
- Check mode reports issues without changing files.
- Build system can format all or selected files.
- Can clean invalid encodings and remove BOMs.
- Available on Windows, macOS, and Linux.
- Formats Zig code only.
- Editor integrations cited are Vim and VSCode.
Plans
Every plan and priceZig fmt (included with Zig)
Free plan
The verdict
Zig fmt covers routine Zig formatting, selective build-system runs, and non-modifying style checks. It is included with the free Zig toolchain and supports the three listed desktop platforms.
What the maker publishes
- Automation
- The download page recommends community mirrors for automated downloads to avoid downtime and help reduce bandwidth costs. source
- Build system
- The Zig build system can run `zig fmt` on a codebase or a subset of it. source
- C and C++ projects
- The Zig home page says developers can use Zig as a zero-dependency C and C++ compiler with cross-compilation, and add Zig compilation units to C/C++ projects. source
- Check mode
- The `--check` flag lists nonconforming files on stdout and exits with an error if the list is nonempty, without modifying file contents. source
- Distribution
- Zig releases are available for Windows, macOS, and Linux, and the download page says release files are signed with minisign. source
- Editor integrations
- The release notes cite integrations for Vim and VSCode. source
- Encoding cleanup
- `zig fmt` can convert invalid source encodings to valid ones, including by stripping byte order marks and carriage returns. source
- How it works
- The formatter uses Zig code parsing support from the standard library. source
- How to run
- The Zig build system can run `zig fmt` on a codebase or a subset of it. source
- Linux support
- The download page lists Zig releases for Linux x86_64, aarch64, arm, riscv64, powerpc64le, x86, loongarch64, and s390x. source
- macOS support
- The download page lists Zig releases for macOS x86_64 and aarch64. source
- Maintainer organization
- The Zig Software Foundation is a 501(c)(3) nonprofit whose mission includes promoting, protecting, and advancing Zig and supporting its community. source
- Maintainer organization
- The Zig Software Foundation is described as a 501(c)(3) nonprofit corporation founded in 2020 to support Zig development. source
- Offline documentation
- The language reference states that its HTML document depends on no external files and can be used offline. source
- Package managers
- The download page says Zig can also be installed from a package manager. source
- Part of Zig
- The download page provides Zig distributions that include the language reference and standard library documentation. source
- Purpose
- `zig fmt` formats Zig code to a canonical style. source
- Purpose
- `zig fmt` is a tool for formatting Zig source code. source
- Release channel
- The download page lists a master build dated 2026-10-08 and links to its language reference and standard library documentation. source
- Signed files
- The download page says files are signed with minisign and provides a public key. source
- Source encoding
- The documentation says `zig fmt` can convert invalid source encodings to valid ones, including by stripping byte order marks and carriage returns. source
- Support and funding
- The foundation asks for recurring donations to fund ongoing software development, maintenance, and support. source
- Who it is for
- Zig describes itself as a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software. source
- Windows support
- The download page lists Zig releases for Windows x86_64, aarch64, and x86. source
Checked against the maker's pages on 8 Oct 2026.