Skip to content
ReviewRamble

The weekly brief

AI, reviewed, in your inbox.

  • New reviews of tools, models, MCP servers and repos, with the verdict up front
  • Re-checked prices and ratings when something changes
  • New analysis pieces as they are published

Models, agents, MCP servers and the tools actually worth your time.

One email a week. Unsubscribe with the link in any brief. How we use your email

fq

jq for binary files: decodes MP4, PCAP, ELF, Protobuf, safetensors and over 100 other formats into a tree you query with jq syntax.

Reviewed by ReviewRamble editors · Updated

View on GitHub Open source

Share this page:XLinkedInFacebookRedditWhatsAppEmail

Our rating

4.2/5

fq turns a hex editor session into a jq one-liner, which is a gift for anyone who already knows jq and a stiff climb for anyone who does not.

What is fq?

fq reads a binary file, works out its format and decodes it into a nested structure you can query with the jq expression language, the same one used for JSON. fq . file prints the decoded tree, fq d file shows it as a structural hex dump with each field next to its bytes, and fq -i opens an interactive REPL with tab completion. Formats nest, so an MP4 decodes down to its AVC or HEVC frames and a PCAP down to TCP segments and TLS records, and you can slice bits, re-encode values and convert to and from JSON, YAML, XML, TOML and CBOR.

The format list has 136 entries, covering media containers and codecs, network captures, archives, executables (ELF, Mach-O, WASM), serialisation formats (Protobuf, MessagePack, BSON, Avro), PostgreSQL and LevelDB files and, since a contributed decoder merged in October 2025, safetensors model files. Each format's quirks and gaps are listed in the manual, which also ships as man fq.

The project is MIT licensed, written in Go and almost entirely the work of Mattias Wadman, who has 2,381 commits against 75 for the next contributor and is also a maintainer of jq itself. It has about 10,600 stars. Releases are steady: v0.16.0 in December 2025, v0.17.0 in March 2026 and v0.18.0 on 25 August 2026, with commits still landing on 30 November 2026.

Is fq worth it?

fq is a quick way to ask a question of a binary file. Where a hex editor shows bytes and leaves the decoding to you, fq names every field, nests formats inside each other and lets you filter with the jq language. Pulling the codec of every track out of an MP4, the TLS server names from a packet capture or the tensor shapes from a safetensors header is one short query rather than a script. Its two Hacker News launches reached 450 points in 2021 and 670 in 2023, and readers there praised the README for listing similar tools alongside its own.

The safetensors decoder is the part most relevant to people working with models. It parses the JSON header, then decodes the tensors themselves as F32, F16, BF16 and integer values, so you can check dtypes, shapes, metadata and even individual weights from the shell. We found no published figures on how it copes with a multi-gigabyte checkpoint.

The catch: fq only knows the formats compiled into it. Commenters on Hacker News asked for a way to plug in external format descriptions, as Kaitai Struct does, and there is none; PDF and Windows PE executables are among the open requests. Decoders vary in depth. One 2023 commenter found the Protobuf support basic, printing field numbers rather than names because it has no schema, and the manual lists unfinished corners in formats such as FIT and BSON. The default JSON output drops bytes that are not valid UTF-8 unless you change bits_format, and the author says the Go API is not stable enough to use as a library. Development rests on one person, though that person has kept releases coming for five years.

Our take: fq belongs in the same toolbox as jq for anyone who regularly opens media files, packet captures or model weights, and it repays the hour it takes to learn jq properly. For a format it does not support, ImHex or a Kaitai Struct spec is the better starting point.

Where it earns its place

  • An ML engineer downloading open-weight checkpoints from Hugging Face

    Check a safetensors file's dtypes, shapes and metadata before loading it into a training or serving stack

    Run fq with a query over the safetensors decode to list tensor names, dtypes and shapes, or spot-check values in one tensor. It needs no Python environment or GPU. Free; decode time on very large checkpoints is not published.

  • A video engineer at a streaming company debugging a player fault

    Find which MP4 box or frame in a file is malformed

    Open the file with fq -i, walk the box tree with tab completion, and use the d function to see the bytes behind a suspect field. A query that worked can go into a shell script and run over a whole folder of files.

  • A network engineer with a PCAP from a failing TLS client

    Pull out the handshake fields without clicking through Wireshark

    Query the pcap decode for TCP segments and TLS records and print the server names and cipher suites as JSON. Decrypting the payload needs traffic in both directions and an NSS key log, according to the manual.

Before you commit

Setup
A single binary from GitHub releases, or brew install wader/tap/fq, scoop install fq, pacman -S fq, sudo port install fq, nix-shell -p fq or the FreeBSD port. On macOS an unsigned download may need to be allowed in security settings. First query in minutes if you know jq.
Integrations
Command line and REPL; reads files or stdin; converts to and from JSON, YAML, XML, TOML, CBOR, base64, hex and PEM; jq-compatible flags such as --arg and --args. Go internals exist but the API is not stable.
Data and privacy
Runs locally and sends nothing anywhere. MIT licence. No security advisories were listed on GitHub when we checked.
Cost at scale
Free. Large files can be slow to decode in full; for big MP4 files the manual offers decode_samples=false to skip per-sample decoding, and the REPL lets you reuse a slow decode.
Limits
Only built-in formats; format detection can guess wrong and need -d NAME; some decoders partial (BSON decimal128, FIT fields, STL ASCII); lossy JSON for binary strings by default; one main maintainer.

What’s good

  • 136 formats decoded into nested, queryable trees
  • Full jq language, plus bit slicing and a structural hex view
  • Decodes safetensors headers and weight values from the shell
  • Single Go binary; steady releases, latest v0.18.0

What’s not

  • No plug-in format descriptions; unsupported formats need Go code
  • Some decoders are shallow, such as schema-less Protobuf
  • Default JSON output loses non-UTF-8 bytes
  • Built and maintained almost entirely by one person

Best for

Developers, media and network engineers, and ML practitioners who already use jq and need to inspect or extract fields from binary files without writing a parser.

fq alternatives

fq: common questions

Is fq worth it?
fq turns a hex editor session into a jq one-liner, which is a gift for anyone who already knows jq and a stiff climb for anyone who does not. We rate it 4.2 out of 5.
How much does fq cost?
Free under the MIT licence; no paid edition.
What are the downsides of fq?
No plug-in format descriptions; unsupported formats need Go code; some decoders are shallow, such as schema-less Protobuf; default JSON output loses non-UTF-8 bytes; built and maintained almost entirely by one person.
Who is fq best for?
Developers, media and network engineers, and ML practitioners who already use jq and need to inspect or extract fields from binary files without writing a parser.
How much does fq cost for a team or in production?
Free. Large files can be slow to decode in full; for big MP4 files the manual offers decode_samples=false to skip per-sample decoding, and the REPL lets you reuse a slow decode.
Is fq safe for company data?
Runs locally and sends nothing anywhere. MIT licence. No security advisories were listed on GitHub when we checked.
What are the best fq alternatives?
The closest alternatives we have reviewed are JSON Crack.

Answers checked Nov 30, 2026.

Make fq? Show this rating on your sitefq rated 4.2 out of 5 on ReviewRamble