encyclopegia.org

Jq (programming language)

jq is a widely-used command-line utility and very high-level, functional, domain-specific programming language designed for processing JSON data.[10] jq filters its input data to produce modified output in a manner similar to AWK or sed.[src] The input typically consists of one or more JSON values but may instead by one or more lines of text.[src] In jq, programs consist of filters that can be composed in pipelines that perform a variety of operations on their inputs.[src]

jq is a widely-used command-line utility and very high-level, functional, domain-specific programming language designed for processing JSON data.[10] jq filters its input data to produce modified output in a manner similar to AWK or sed.[src] The input typically consists of one or more JSON values but may instead by one or more lines of text.[src] In jq, programs consist of filters that can be composed in pipelines that perform a variety of operations on their inputs.[src] ==History== jq was created by Stephen Dolan, and released in October 2012.[src] It was described as being "like sed for JSON data".[7] Support for regular expressions was added in jq version 1.5.[src] The original implementation of jq was in Haskell before being ported to the language C.[src] The jq language was subsequently implemented in other programming languages: gojq is an implementation in Go; jaq is an implementation with some variations in Rust; jqjq implements a substantial subset of jq in jq itself.[1] ==Use== ===Command-line use=== jq is typically used at the command line and can be used with other command-line utilities, such as GNU Wget.[15] Here is an example showing how the output of a command can be piped to a jq filter to determine the category names associated with this Wikipedia page: $ wget -qO- 'https://en.wikipedia.org/w/api.php?action=parse&page=jq_(programming_language)&format=json' | jq '.parse.categories[]."*"' The output produced by this pipeline consists of a stream of JSON strings, the first few of which are: "CS1_errors:_missing_title" "CS1_errors:_bare_URL" "Articles_with_short_description" "Short_description_matches_Wikidata" "Official_website_not_in_Wikidata" "Dynamically_typed_programming_languages" "Functional_languages" "Programming_languages" "Programming_languages_created_in_2012" "Query_languages" "2012_software" "Articles_with_example_code" The command above uses the MediaWiki API for this page to produce a JSON response.[17] The pipe allows the output of to be accessed by jq, a standard Unix shell mechanism.[src] The jq filter shown is an abbreviation for the jq pipeline: .["parse"] | .["categories"] | .[] | .["*"] This corresponds to the nested JSON structure produced by the call to .[src] Notice that the jq pipeline is constructed in the same manner using the character as the Unix-style pipeline.[src] ==Modes of operation== jq by default acts as a "stream editor" for JSON inputs, much like the sed utility is the "stream editor" for lines of text.[7] However jq has several other modes of operation: it can treat its input from one or more sources as lines of text; it can gather a stream of inputs from a specified source into a JSON array; it can parse its JSON inputs using a so-called "streaming parser" that produces a stream of [path, value] arrays for all "leaf" paths.[src] The streaming parser is very useful when one of more of the JSON inputs is too large to fit in memory, since its memory needs are usually quite small.[src] For example, for an arbitrarily large array of JSON objects, the peak memory need is little more than needed to handle the largest top-level object.[src] These modes of operation can, within certain limitations, be combined.[src] ==Syntax and semantics== ===Types=== Every JSON value is also a value in jq, which accordingly has the data types shown in the table below.[src] is a value, just like any other JSON scalar; it is not a pointer or a "null pointer".[src] (corresponding to NaN) and (see IEEE 754) are the only two jq scalars that are not also JSON values.[src] ===Forms=== Special syntactic forms exist for function creation, conditionals, stream reduction, and the module system.[src] ===Filters=== Here is an example of defining a named, parameterized filter for formatting an integer in any base from 2 to 36 inclusive.[src] The implementation illustrates tacit (or point-free) programming: def tobase($b): def digit: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[.:.+1]; def mod: .[src] % $b; def div: ((.[src] - mod) / $b); def digits: recurse( select(.[src] >= $b) | div) | mod ; select(2 The next example demonstrates the use of generators in the classic "SEND MORE MONEY" verbal arithmetic game: def send_more_money: def choose(m;n;used): ([range(m;n+1)] - used)[]; def num(a;b;c;d): 1000*a + 100*b + 10*c + d; def num(a;b;c;d;e): 10*num(a;b;c;d) + e; first( 1 as $m | 0 as $o | choose(8;9;[]) as $s | choose(2;9;[$s]) as $e | choose(2;9;[$s,$e]) as $n | choose(2;9;[$s,$e,$n]) as $d | choose(2;9;[$s,$e,$n,$d]) as $r | choose(2;9;[$s,$e,$n,$d,$r]) as $y | select(num($s;$e;$n;$d) + num($m;$o;$r;$e) == num($m;$o;$n;$e;$y)) | [$s,$e,$n,$d,$m,$o,$r,$e,$m,$o,$n,$e,$y] ); ==External links== – jq FAQ The jq Programming Language page on the Rosetta Code comparative programming tasks project site[18]

32 sentences · 32 cited inline · 18 references stored

References

  1. jqjq: jq implementation of jq · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "jqjq: jq implementation of jq." Wadman, Mattias (2022). 2026-11-19. https://github.com/wader/jqjq. Accessed 25 November 2026.

    Chicago "jqjq: jq implementation of jq." Wadman, Mattias (2022). 2026-11-19. https://github.com/wader/jqjq.

    APA Wadman, Mattias (2022). (2026). jqjq: jq implementation of jq. Retrieved November 25, 2026, from https://github.com/wader/jqjq

  2. Includes, but not limited to. Wikipedia revision 1370035162, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Includes, but not limited to. Wikipedia revision 1370035162, retrieved 2026-11-20." Includes, but not limited to. 2026-11-19. https://en.wikipedia.org/w/index.php?oldid=1370035162. Accessed 25 November 2026.

    Chicago "Includes, but not limited to. Wikipedia revision 1370035162, retrieved 2026-11-20." Includes, but not limited to. 2026-11-19. https://en.wikipedia.org/w/index.php?oldid=1370035162.

    APA Includes, but not limited to. (2026). Includes, but not limited to. Wikipedia revision 1370035162, retrieved 2026-11-20. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1370035162

  3. Initial: jqlang/Jq@eca89ac · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Initial: jqlang/Jq@eca89ac." 2026-11-19. https://github.com/jqlang/jq/commit/eca89acee00faf6e9ef55d84780e6eeddf225e5c. Accessed 25 November 2026.

    Chicago "Initial: jqlang/Jq@eca89ac." 2026-11-19. https://github.com/jqlang/jq/commit/eca89acee00faf6e9ef55d84780e6eeddf225e5c.

    APA encyclopegia.org. (2026). Initial: jqlang/Jq@eca89ac. Retrieved November 25, 2026, from https://github.com/jqlang/jq/commit/eca89acee00faf6e9ef55d84780e6eeddf225e5c

  4. Janssens 2014 . Wikipedia revision 1370035162, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Janssens 2014 . Wikipedia revision 1370035162, retrieved 2026-11-20." Janssens 2014. 2026-11-19. https://en.wikipedia.org/w/index.php?oldid=1370035162. Accessed 25 November 2026.

    Chicago "Janssens 2014 . Wikipedia revision 1370035162, retrieved 2026-11-20." Janssens 2014. 2026-11-19. https://en.wikipedia.org/w/index.php?oldid=1370035162.

    APA Janssens 2014. (2026). Janssens 2014 . Wikipedia revision 1370035162, retrieved 2026-11-20. Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1370035162

  5. jqlang · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "jqlang." 2026-11-19. https://github.com/jqlang/jq/blob/master/NEWS. Accessed 25 November 2026.

    Chicago "jqlang." 2026-11-19. https://github.com/jqlang/jq/blob/master/NEWS.

    APA encyclopegia.org. (2026). jqlang. Retrieved November 25, 2026, from https://github.com/jqlang/jq/blob/master/NEWS

  6. Tutorial · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Tutorial." 2026-11-19. https://jqlang.github.io/jq/tutorial/. Accessed 25 November 2026.

    Chicago "Tutorial." 2026-11-19. https://jqlang.github.io/jq/tutorial/.

    APA encyclopegia.org. (2026). Tutorial. Retrieved November 25, 2026, from https://jqlang.github.io/jq/tutorial/

  7. like sed · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "like sed." 2026-11-19. https://web.archive.org/web/20130414054332/http://stedolan.github.io/jq. Accessed 25 November 2026.

    Chicago "like sed." 2026-11-19. https://web.archive.org/web/20130414054332/http://stedolan.github.io/jq.

    APA encyclopegia.org. (2026). like sed. Retrieved November 25, 2026, from https://web.archive.org/web/20130414054332/http://stedolan.github.io/jq

  8. Download jq · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Download jq." a b "Download jq". 2026-11-19. https://jqlang.org/download. Accessed 25 November 2026.

    Chicago "Download jq." a b "Download jq". 2026-11-19. https://jqlang.org/download.

    APA a b "Download jq". (2026). Download jq. Retrieved November 25, 2026, from https://jqlang.org/download

  9. Release v0.0.1 · itchyny/gojq · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Release v0.0.1 · itchyny/gojq." "Release v0. 2026-11-19. https://github.com/itchyny/gojq/releases/tag/v0.0.1. Accessed 25 November 2026.

    Chicago "Release v0.0.1 · itchyny/gojq." "Release v0. 2026-11-19. https://github.com/itchyny/gojq/releases/tag/v0.0.1.

    APA "Release v0. (2026). Release v0.0.1 · itchyny/gojq. Retrieved November 25, 2026, from https://github.com/itchyny/gojq/releases/tag/v0.0.1

  10. Homer, Michael (19 October 2023). Branching Compositional Data Transformations in jq, Visually . Proceedings of the 2nd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments . New York: Association for Computing Machinery. pp. 11– 16. doi : 10.1145/3623504.3623567 . ISBN 9798400703997 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Homer, Michael (19 October 2023). Branching Compositional Data Transformations in jq, Visually . Proceedings of the 2nd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments . New York: Association for Computing Machinery. pp. 11– 16. doi : 10.1145/3623504.3623567 . ISBN 9798400703997 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20." Homer, Michael (19 October 2023). 2026-11-19. https://dl.acm.org/doi/10.1145/3623504.3623567. Accessed 25 November 2026.

    Chicago "Homer, Michael (19 October 2023). Branching Compositional Data Transformations in jq, Visually . Proceedings of the 2nd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments . New York: Association for Computing Machinery. pp. 11– 16. doi : 10.1145/3623504.3623567 . ISBN 9798400703997 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20." Homer, Michael (19 October 2023). 2026-11-19. https://dl.acm.org/doi/10.1145/3623504.3623567.

    APA Homer, Michael (19 October 2023). (2026). Homer, Michael (19 October 2023). Branching Compositional Data Transformations in jq, Visually . Proceedings of the 2nd ACM SIGPLAN International Workshop on Programming Abstractions and Interactive Notations, Tools, and Environments . New York: Association for Computing Machinery. pp. 11– 16. doi : 10.1145/3623504.3623567 . ISBN 9798400703997 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20. Retrieved November 25, 2026, from https://dl.acm.org/doi/10.1145/3623504.3623567

  11. 01mf02/jaq: A jq clone focussed on correctness, speed, and simplicity · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "01mf02/jaq: A jq clone focussed on correctness, speed, and simplicity." 2026-11-19. https://github.com/01mf02/jaq. Accessed 25 November 2026.

    Chicago "01mf02/jaq: A jq clone focussed on correctness, speed, and simplicity." 2026-11-19. https://github.com/01mf02/jaq.

    APA encyclopegia.org. (2026). 01mf02/jaq: A jq clone focussed on correctness, speed, and simplicity. Retrieved November 25, 2026, from https://github.com/01mf02/jaq

  12. Denotational Semantics and a fast interpreter for jq · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Denotational Semantics and a fast interpreter for jq." a b c Färber, Michael (2023). 2026-11-19. https://en.wikipedia.org/wiki/ArXiv_(identifier). Accessed 25 November 2026.

    Chicago "Denotational Semantics and a fast interpreter for jq." a b c Färber, Michael (2023). 2026-11-19. https://en.wikipedia.org/wiki/ArXiv_(identifier).

    APA a b c Färber, Michael (2023). (2026). Denotational Semantics and a fast interpreter for jq. Retrieved November 25, 2026, from https://en.wikipedia.org/wiki/ArXiv_(identifier)

  13. jq 1.8 Manual · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "jq 1.8 Manual." a b c "jq 1. 2026-11-19. https://jqlang.org/manual/. Accessed 25 November 2026.

    Chicago "jq 1.8 Manual." a b c "jq 1. 2026-11-19. https://jqlang.org/manual/.

    APA a b c "jq 1. (2026). jq 1.8 Manual. Retrieved November 25, 2026, from https://jqlang.org/manual/

  14. Querying JSON and XML with jq and xq · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Querying JSON and XML with jq and xq." Asher, Ben (9 January 2022). 2026-11-19. https://www.ashbyhq.com/blog/engineering/jq-and-yq. Accessed 25 November 2026.

    Chicago "Querying JSON and XML with jq and xq." Asher, Ben (9 January 2022). 2026-11-19. https://www.ashbyhq.com/blog/engineering/jq-and-yq.

    APA Asher, Ben (9 January 2022). (2026). Querying JSON and XML with jq and xq. Retrieved November 25, 2026, from https://www.ashbyhq.com/blog/engineering/jq-and-yq

  15. yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents." Andrey, Kislyuk. 2026-11-19. https://kislyuk.github.io/yq/. Accessed 25 November 2026.

    Chicago "yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents." Andrey, Kislyuk. 2026-11-19. https://kislyuk.github.io/yq/.

    APA Andrey, Kislyuk. (2026). yq: Command-line YAML/XML/TOML processor - jq wrapper for YAML, XML, TOML documents. Retrieved November 25, 2026, from https://kislyuk.github.io/yq/

  16. Farah, Mike. "yq" . yq . Archived from the original on 20 August 2025 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "Farah, Mike. "yq" . yq . Archived from the original on 20 August 2025 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20." Farah, Mike. 2026-11-19. https://mikefarah.gitbook.io/yq/. Accessed 25 November 2026.

    Chicago "Farah, Mike. "yq" . yq . Archived from the original on 20 August 2025 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20." Farah, Mike. 2026-11-19. https://mikefarah.gitbook.io/yq/.

    APA Farah, Mike. (2026). Farah, Mike. "yq" . yq . Archived from the original on 20 August 2025 . Retrieved 27 September 2025 . Wikipedia revision 1370035162, retrieved 2026-11-20. Retrieved November 25, 2026, from https://mikefarah.gitbook.io/yq/

  17. https://github.com/jqlang/jq . {{ cite web }} : Missing or empty |title= ( help ) Wikipedia revision 1370035162, retrieved 2026-11-20 · retrieved 2026-11-19 · rev 1370035162
    Cite this reference

    MLA "https://github.com/jqlang/jq . {{ cite web }} : Missing or empty |title= ( help ) Wikipedia revision 1370035162, retrieved 2026-11-20." https://github. 2026-11-19. https://github.com/jqlang/jq. Accessed 25 November 2026.

    Chicago "https://github.com/jqlang/jq . {{ cite web }} : Missing or empty |title= ( help ) Wikipedia revision 1370035162, retrieved 2026-11-20." https://github. 2026-11-19. https://github.com/jqlang/jq.

    APA https://github. (2026). https://github.com/jqlang/jq . {{ cite web }} : Missing or empty |title= ( help ) Wikipedia revision 1370035162, retrieved 2026-11-20. Retrieved November 25, 2026, from https://github.com/jqlang/jq

  18. Jq (programming language) · retrieved 2026-10-19 · rev 1370035162
    Cite this reference

    MLA "Jq (programming language)." Wikipedia. 2026-10-19. https://en.wikipedia.org/w/index.php?oldid=1370035162. Accessed 25 November 2026.

    Chicago "Jq (programming language)." Wikipedia. 2026-10-19. https://en.wikipedia.org/w/index.php?oldid=1370035162.

    APA Wikipedia. (2026). Jq (programming language). Retrieved November 25, 2026, from https://en.wikipedia.org/w/index.php?oldid=1370035162

Cite this article

MLA

"Jq (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/jq-programming-language. Accessed 25 November 2026.

Chicago

"Jq (programming language)." encyclopegia.org. Accessed November 25, 2026. https://encyclopegia.org/wiki/jq-programming-language.

APA

encyclopegia.org. (2026). Jq (programming language). Retrieved November 25, 2026, from https://encyclopegia.org/wiki/jq-programming-language

Accessed November 25, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
release date2012Wikipedia

Related articles

official language

stub · references available

pan-Slavic language

stub · references available

Hawaiʻi Sign Language

stub · references available

Taiwanese Sign Language

stub · references available

Category:Programming languages

stub · references available

International Mother Language Day

stub · references available

polysynthetic language

stub · references available

Category:Films by country or language

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1370035162 · 0.5 · snapshot enwiki-001370035162

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.