10,602 stars · MIT (read from /blob/master/LICENSE; plain and unmodified, Mattias Wadman 2021, and the same file credits itchyny 2019-2021 for the forked colorjson and gojqextra code) · v0.18.0 (2026-08-25, year confirmed by pkg.go.dev) · Track this in Scout
Decodes a file that is not text into a structure you can query with a jq-style language.
▶Repo detailsthe review · specs · pros & cons · install
What it is
fq is a single command-line program written in Go. It understands more than a hundred file formats and turns each one into a tree of named fields, which you then query using the same language as jq, the standard tool for picking values out of JSON. It also has a hex view and an interactive prompt.
What it is good for. The moment when a file will not play, will not upload, or is the wrong size and nothing tells you why. A photograph with the wrong rotation, an audio file whose length is reported wrongly, a video a service refuses — all of these live in a few bytes somewhere inside, and this is the tool that shows you those bytes with their proper names. It also replaces a lot of guessing when you are writing code that handles media.
- More than a hundred formats in one downloaded program: audio, video, images, archives, network captures, certificates and more. There is nothing to install per format.
- It is read-only. Pointed at a file you care about, it cannot damage it.
- Plain MIT, read from the licence file, with the original author named and proper credit given in the same file to the author of the code it borrowed.
- It is only useful if you can write a
jqexpression, or are willing to learn one. There is no screen and no menu. - Installing from source needs Go on your machine first, unless your package manager happens to carry it. The project does list a wide set of package managers, so that is often avoidable.
- The output is a deep structure. It will tell you exactly what is in the file, and it will not tell you which of those fields is the one causing your problem.
- WerWolv/ImHex
The same job of making a non-text file readable, but as a graphical editor with its own pattern language, and it can write as well as read; GPL-2.0 with its library part under LGPL-2.1.
Track this in Scout - kaitai-io/kaitai_struct
The same idea of describing a binary format once, but it generates reading code in other programming languages instead of inspecting a file there and then.
Track this in Scout - ReFirmLabs/binwalk
Also finds structures inside a binary file, but aimed at pulling files out of device firmware rather than naming every field of a known format.
Track this in Scout
brew install wader/tap/fq
