Binary data analysis tool that applies jq-like queries to decode and inspect file formats
fq is a binary data analysis tool that combines the functionality of jq, hexdump, dd, and gdb into a single command-line interface. It decodes binary formats and presents them as structured data that can be queried using jq-style expressions. The tool supports over 130 file formats including media codecs (MP4, FLAC, JPEG), executables (ELF, Mach-O), network captures (PCAP with TCP reassembly), serialization formats (JSON, YAML, protobuf, CBOR), and specialized formats like Bitcoin blocks and PostgreSQL database files.
The tool provides an interactive REPL with auto-completion and can transform, slice, and concatenate binary data. It handles nested formats and bit-oriented decoding, making it particularly useful for reverse engineering and debugging binary file formats. Basic usage follows the pattern fq . file, fq d file, or fq 'some query' file for applying specific queries to binary data.
Originally designed for media codec analysis, fq has expanded to support packet captures, executables, databases, and various binary protocols. It includes utility functions for working with URLs, hex conversion, number bases, and pattern searching. The tool is targeted at developers, reverse engineers, and anyone working with binary file formats who needs to inspect, query, or debug structured binary data.
# via Homebrew
brew install wader/tap/fq
# via Go
go install github.com/wader/fq@latest
# via Scoop
scoop install fq