HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
jqlang
jq
C2012–2026
jqlang / jq

jq

Command-line JSON processor

79Distinct people
104Mentions
2Explicit recommenders
36.1KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Command-line JSON processor

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I highly recommend anyone to look at jq's VM implementation some time, it's kind of mind-blowing how it works under the hood:…

bouk used a recommendation phrase. 2 indexed comments match. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year104 dated mentions

Observed mentions: 2012-10-21 17:50:32 UTC to 2026-03-29 02:02:20 UTC.

05101520252012-01-01 00:00:00 UTC to 2013-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments20122013-01-01 00:00:00 UTC to 2014-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments2014-01-01 00:00:00 UTC to 2015-01-01 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2015-01-01 00:00:00 UTC to 2016-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2016-01-01 00:00:00 UTC to 2017-01-01 00:00:00 UTC (exclusive): 2 mentions; 1 submissions, 1 comments2017-01-01 00:00:00 UTC to 2018-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2018-01-01 00:00:00 UTC to 2019-01-01 00:00:00 UTC (exclusive): 12 mentions; 0 submissions, 12 comments2019-01-01 00:00:00 UTC to 2020-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments20192020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 9 mentions; 0 submissions, 9 comments2021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 8 mentions; 3 submissions, 5 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 14 mentions; 3 submissions, 11 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 25 mentions; 5 submissions, 20 comments2024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 11 mentions; 0 submissions, 11 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 8 mentions; 2 submissions, 6 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20122012-01-01 00:00:00 UTC2013-01-01 00:00:00 UTC101
20132013-01-01 00:00:00 UTC2014-01-01 00:00:00 UTC202
20142014-01-01 00:00:00 UTC2015-01-01 00:00:00 UTC000
20152015-01-01 00:00:00 UTC2016-01-01 00:00:00 UTC211
20162016-01-01 00:00:00 UTC2017-01-01 00:00:00 UTC211
20172017-01-01 00:00:00 UTC2018-01-01 00:00:00 UTC101
20182018-01-01 00:00:00 UTC2019-01-01 00:00:00 UTC12012
20192019-01-01 00:00:00 UTC2020-01-01 00:00:00 UTC707
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC909
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC835
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC14311
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC25520
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC11011
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC826
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
jq jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It's written in portable C and has zero runtime dependencies, allowing you to easily slice, filter, map, and transform structured data. Documentation Official Documentation: jqlang.org Try jq Online: play.jqlang.org Installation Prebuilt Binaries Download the latest releases from the GitHub release page. The platform-specific assets are standalone executables, not archives. On macOS and Linux, rename the downloaded file to jq and make it executable with chmod +x jq. Docker Image Pull the jq image to start quickly with Docker. Run with Docker Example: Extracting the version from a package.json file docker run --rm -i ghcr.io/jqlang/jq:latest < package.json '.version' Example: Extracting the version from a package.json file with a mounted volume docker run --rm -i -v "$PWD:$PWD" -w "$PWD" ghcr.io/jqlang/jq:latest '.version' package.json Building from source Dependencies libtool make automake autoconf Instructions git submodule update --init # if building from git to get oniguruma autoreconf -i # if building from git ./configure --with-oniguruma=builtin make clean # if upgrading from a version previously built from source make -j8 make check sudo make install sudo ldconfig # on Linux, if jq cannot find libjq.so Build a statically linked version: make clean make LDFLAGS=-all-static If you're not using the latest git version but instead building a released tarball (available on the release page), skip the autoreconf step, and flex or bison won't be needed. Cross-Compilation For details on cross-compilation, check out the GitHub Actions file and the cross-compilation wiki page. Community & Support Questions & Help: Stack Overflow (jq tag) Chat & Community: Join us on Discord Wiki & Advanced Topics: Explore the Wiki License jq is released under the MIT License. jq's documentation is licensed under the Creative Commons CC BY 3.0. jq uses parts of the open source C library "decNumber", which is distributed under ICU License
Read the full README on GitHub

What Hacker News says

104 sources
I think that in most cases jq is launched to extract value from relatively small JSON document, for which raw parsing speed is not affect much. jq is just really slow to start. Version 1.6 was especially abysmally slow to start, 10x times slower than 1.5: https://github.com/jqlang/jq/issues/1826 So any replacement candidate should also benchmark like hyperfine "jq .a <<< '{"a": 10 }'" . This oneliner does not work but should illustrate the idea. Also please just use jshon if you need to just extract specific value from some small JSON. jshon uses way less resources by any conceivable metric.
In A Faster Alternative to Jq
Got a bit nerd-sniped here, but first of all we can reduce if A then B else . end === if A then B end since jq 1.7: jq 'walk(if type == "array" then (if length > 0 then [.[0]] end) end)' Now we could contract those conditionals: jq 'walk(if type == "array" and length > 0 then [.[0]] end)' but it turns out we can even more usefully express if length > 0 then [.[0]] end === [limit(1; .[])] == .[:1]: jq 'walk(if type == "array" then .[:1] end)' From here, we can golf it a little further (this is kind of a generic type-matching pattern): jq 'walk(arrays[:1] // .)' although this does incur a bit more overhead than checking type directly. Speaking of overhead, though, it turns out that the implementation of walk/1 (https://github.com/jqlang/jq/blob/master/src/builtin.jq#L212) will actually run the filter on every element of
Read the rest
an array, even though we're about to throw most of them out, which we can eliminate by writing the recursion explicitly: jq 'def w: if type=="array" then [limit(1; .[]|w)] elif type=="object" then .[] |= w end; w' which gets the operation down from ~200 ms on my machine (not long enough to really get distracted, but enough to feel the wait) to a perceptually instant ~40 ms (which is mostly just the cost of reading the input). Now we can golf it down a little more: jq 'def w: if type=="array" then [limit(1; .[]|w)] else objects[] |= w end; w' jq 'def w: (arrays[:1]|map(w)) // (objects[] |= w); w' (the precedence here actually allows us to eliminate the parens here...) jq 'def w: arrays |= .[:1]|iterables[] |= w; w' And, inaccessibility of the syntax aside, I think this does an incredible job of expressing the essence of what we're trying to do: we trim any array down to its first element, and then recursively apply the same transformation throughout the structure. jq is a very expressive language, it just looks like line noise...
In Jqfmt like gofmt, but for jq
Oh, fantastic. jq has become an integral part of work for me. I'll use this opportunity to plug the one-liner I use all the time, which summarizes the "structure" of a doc in a jq-able way: https://github.com/stedolan/jq/issues/243#issuecomment-48470... (I didn't write it, I'm just a happy user) For example: $ curl -s 'https://ip-ranges.amazonaws.com/ip-ranges.json' | jq -r '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]' . .createDate .ipv6_prefixes .ipv6_prefixes[] .ipv6_prefixes[].ipv6_prefix .ipv6_prefixes[].network_border_group .ipv6_prefixes[].region .ipv6_prefixes[].service .prefixes .prefixes[] .prefixes[].ip_prefix .prefixes[].network_border_group .prefixes[].region .prefixes[].service .syncToken
Read the rest
(except I have it aliased to "jq-structure" locally of course. also, if there's a new fancy way to do this, I'm all ears; I've been using this alias for like... almost a decade now :/) In the spirit of trying out jqfmt, let's see how it formats that one-liner... ~ echo '[path(..)|map(if type=="number" then "[]" else tostring end)|join(".")|split(".[]")|join("[]")]|unique|map("."+.)|.[]' | ~/go/bin/jqfmt -ob -ar -op pipe [ path(..) | map(if type == "number" then "[]" else tostring end) | join(".") | split(".[]") | join("[]") ] | unique | map("." + .) | .[]% ~ Not bad! Shame that jqfmt doesn't output a newline at the end, though. The errant `%` is zsh's partial line marker. Also, `-ob -ar -op pipe` seems like a pretty good set of defaults to me - I would prefer that over it (seemingly?) not doing anything with no flags. (At least for this sample snippet.)
In Jqfmt like gofmt, but for jq
I came up with a scheme a number of years ago that takes advantage of the illegality of overlong encodings [0]. Obviously UTF-8 has 256 code units (<00> to <FF>). 128 of them are always valid within a UTF-8 string (ASCII, <00> to <7F>), leaving 128 code units that could be invalid within a UTF-8 string (<80> to <FF>). There also happen to be exactly 128 2-byte overlong representations (overlong representations of ASCII characters). Basically, any byte in some input that can't be interpreted as valid UTF-8 can be replaced with a 2-byte overlong representation. This can be used as an extension of WTF-8 so that UTF-16 and UTF-8 errors can both be stored in the same stream. I called the encoding WTF-8b [2], though I'd be interested to know if someone else has come up with the same scheme. This should technically be "fine" WRT Unicode text pro
Read the rest
cessing, since it involves transforming invalid Unicode into other invalid Unicode. This principle is already used by WTF-8. I used it to improve preservation of invalid Unicode (ie, random 8-bit data in UTF-8 text or random 16-bit data in JSON strings) in jq, though I suspect the PR [1] won't be accepted. I still find the changes very useful personally, so maybe I'll come up with a different approach some time. [0] https://github.com/Maxdamantus/jq/blob/911d01aaa5bd33137fadf... [1] https://github.com/jqlang/jq/pull/2314 [2] I think I used the name "WTF-8b" as an allusion to UTF-8b/surrogateescape/PEP-383 which also encodes ill-formed UTF-8, though UTF-8b is less efficient storage-wise and is not compatible with WTF-8.
In Corrected UTF-8 (2022)
Hi HN, we ran jq (github.com/jqlang/jq) through our static analysis tool. It's a fantastic, mature project (13 yrs, 230+ authors, Grade A avg. complexity). However, we found some serious concerns: multiple potential buffer overflows (Red Flags in 9 core files), path traversal issues, and a very low test health score (2.9/100). Given its widespread use, these findings are pretty significant for anyone relying on it, especially in production pipelines. Full breakdown and data in the post. Curious about your thoughts/experiences.
In Analysis of Jq: Strengths, Critical Security Risks, and 2.9% Test Coverage
I hope you enjoy it! I sure did. If you enjoy it, you might also enjoy jq (https://github.com/jqlang/jq), which is also a sort of logic programming language (in that it has pervasive generators and backtracking). Icon has an Algol family syntax, while jq is more... Haskell-ish? in a way if you squint hard? Whereas Prolog is a pile of rules. These differences are very interesting. Verse is another language in this vein, and it seems very interesting as well. Oh, and yesterday's HN thread about Rama is very interesting as well: https://news.ycombinator.com/item?id=41833629
In Can logic programming be liberated from predicates and backtracking? [pdf]
In this case, the best tool for the job is the one that will let you: 1. Continue to easily iterate on the solution now and in the future (compiled languages have a built-in hinderance, in that you never know when a given binary corresponds to some state of the source tree) 2. Allow you to trivially talk to inotify/ReadDirectoryChangesW /FSEvents/kqueue/etc so that you only need to read the file when it actually changes 3. Minimise maintenance (installing third-party headers/libraries, setting up a project, etc etc) I think the answer here is the shell, fswatch, and jq. https://github.com/emcrisostomo/fswatch https://github.com/jqlang/jq http://man.openbsd.org/sh
In It is never too late to write your own C/C++ command-line utilities

Showing the 15 most recent of 104 sources. Enable JavaScript to search and browse every indexed mention.

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.