Repolode
wader

wader/fq

A jq-like command-line tool and query language for inspecting and querying binary file formats, with decoders for dozens of formats.

Open-source alternative to:HexFiendImHex

Stars
10,628
Forks
258
Open issues
59
Last commit
12 hours ago

What is it?

fq is a command-line tool for working with binary files. It uses the same expression language as jq, so queries you already know apply to binary data: you can pipe a file through a query and get back decoded fields rather than raw bytes.

The tool ships with a large set of built-in decoders covering formats such as MP4, PNG, ELF, PCAP, TLS, Protobuf, ZIP, and many media and network formats. It shows a structural hex view of decoded data, can decode nested formats (for example a format inside a container), and supports slicing and concatenating binary data at the bit level. An interactive REPL with auto-completion is included.

fq is written in Go, runs on macOS, Linux, and Windows, and is distributed through Homebrew, scoop, pacman, Nix, and other package managers.

Key features

  • 01Queries binary files with jq-compatible expression language.
  • 02Ships decoders for many formats including media, network and archive files.
  • 03Structural hex viewer shows decoded fields alongside raw bytes.
  • 04Decodes nested formats and supports bit-level slicing and concatenation.
  • 05Includes an interactive REPL with auto-completion.

Use cases

  • Inspecting the internal structure of a media file or container during debugging.
  • Analyzing packet captures or protocol messages from the command line.
  • Extracting specific fields from binary formats in shell scripts.
  • Learning how a file format is laid out by exploring its decoded tree.

Quick start

  1. 1

    Install via Homebrew on macOS

    brew install wader/tap/fq
  2. 2

    Install on Windows via Scoop

    scoop install fq
  3. 3

    Or install with Go (requires Go 1.22 or later)

    go install github.com/wader/fq@latest
  4. 4

    Run it on a file

    fq . file

Things to know

  • The README states the project is MIT-licensed, but metadata lists the license as NOASSERTION, so verify the license before reuse.

In collections

Topics

#binary#cli#jq#hexdump#file-formats#decoder#golang#decode#go#json

FAQ

What is fq?
A jq-like command-line tool and query language for inspecting and querying binary file formats, with decoders for dozens of formats. fq is a command-line tool for working with binary files. It uses the same expression language as jq, so queries you already know apply to binary data: you can pipe a file through a query and get back decoded fields rather than raw bytes.
Is fq free to use? What license does it have?
fq is open source under the Other license. Check the license terms before using it in commercial products.
Is fq still maintained?
Actively maintained. The last commit to fq was on Nov 7, 2026.
What can I use fq for?
Inspecting the internal structure of a media file or container during debugging. Analyzing packet captures or protocol messages from the command line. Extracting specific fields from binary formats in shell scripts. Learning how a file format is laid out by exploring its decoded tree.
How do I install fq?
Install via Homebrew on macOS: brew install wader/tap/fq Install on Windows via Scoop: scoop install fq Or install with Go (requires Go 1.22 or later): go install github.com/wader/fq@latest Run it on a file: fq . file
Where can I get fq?
The source code and installation instructions are on GitHub: https://github.com/wader/fq

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects