FREEDOM251

Freedom251 › JSON Tools

gojq

Free plan LinuxMacSelf-hostedWindows

Visit gojq Alternatives Pricing

gojq's own site

What gojq is

gojq is a pure Go implementation of the jq command for querying JSON, and it can also be embedded as a library in Go products. The command applies jq-style queries to JSON input, including filtering, selecting fields, and updating data; it can process multiple input values. gojq also supports YAML input and output. For integer calculations, it handles arbitrary-precision addition, subtraction, multiplication, modulo, and divisible division. The project describes the implementation as portable and lists Linux, macOS, Windows, and self-hosted use. Installation options include Homebrew, mise, Zero Install, source builds, and Docker images. In Go applications, developers can parse and run queries, compile them for reuse, and configure custom functions and iterators. Some jq behavior is not supported: gojq does not preserve object key order, parse NaN, Infinity, or leading-zero number extensions, and some regular-expression syntax differs. The software is released under the MIT License and its listed plan costs nothing.

Who it suits

gojq suits people who want jq-style JSON queries, including Go developers seeking to embed query execution in an application. Its YAML support and portable implementation may also suit users working across listed platforms.

What it does well

  • Runs jq-style queries against JSON input.
  • Supports YAML input and output.
  • Offers arbitrary-precision integer calculations.
  • Can be embedded as a Go library.

What to know first

  • Does not preserve object key order.
  • Does not parse jq's NaN or Infinity extensions.
  • Some regular-expression syntax differs from jq.
  • Library queries may run indefinitely or produce no output.

Limits

The Free plan is MIT-licensed open-source software with a CLI and Go library. It does not preserve object key order and does not support some jq extensions, functions, flags, and regular-expression features; embedded queries may also run indefinitely or produce no output.

Plans

PlanBilled and limitsPrice
FreeMIT-licensed open-source software · CLI and Go libraryFree

As github.com lists them, read 11 Oct 2026. The maker's own page has the final word.

Getting started

  1. Visit the gojq GitHub project.
  2. Choose an installation route: Homebrew, mise, Zero Install, source build, or Docker image.
  3. Install it for Linux, macOS, Windows, or self-hosted use.
  4. Apply jq-style queries to JSON input, or embed the library in a Go application.
  5. For library use, configure an environment loader or module loader if needed.

gojq is a portable Go command-line tool for jq-style JSON queries, with a library for embedding those queries in Go applications. It is best suited to developers who want JSON and YAML handling in a Go-based workflow. Its main appeal is the combination of a free CLI and configurable library; its main caveat is that jq compatibility has meaningful limits.

Overview

The CLI filters JSON, selects fields, makes updates, and accepts multiple input values. YAML input and output extend it to workflows that cross between the two formats. Because gojq is implemented in Go, it is designed to be portable and can be installed through Homebrew, mise, Zero Install, source builds, or Docker images.

That portability does not make it a drop-in replacement for every jq script. gojq does not preserve object key order, so it has neither keys_unsorted nor the --sort-keys option. It also differs on numeric extensions, regular-expression syntax, and other jq functions and flags. Scripts that rely on those behaviors need a compatibility check before switching.

Key features

Querying and number handling

Queries use jq-style syntax for filtering, field selection, and updates. Arbitrary-precision integer calculations cover addition, subtraction, multiplication, modulo, and divisible division, which helps when these operations need to preserve large integer values. That precision has a boundary: mathematical functions such as floor and round convert integers to floating-point numbers. gojq also rejects jq's NaN, Infinity, and leading-zero number extensions.

YAML support

YAML input and output are useful when data needs to move through a JSON-query workflow without first being confined to JSON. This makes gojq more versatile for format conversion and inspection than a JSON-only command would be, while its jq compatibility gaps still apply to the query language.

Embedding in Go

Go applications can parse and run queries, compile a query for reuse, and provide custom functions and iterators. That is a substantial advantage for products that need query behavior inside their own Go code rather than as a separate command. The library expects arrays as []any and maps as map[string]any, so callers must provide inputs in those forms.

Library access to OS environment variables is off by default for security and can be enabled with a configured environment loader. Module loading is also disabled by default and requires a module loader to be configured. Queries can produce infinitely many values or run without producing output, so applications should use RunWithContext to limit execution time.

Pricing

gojq is free at free. The free plan includes the MIT-licensed open-source software, CLI, and Go library. There is no paid tier or trial to weigh against it; the practical trade-off is the engineering effort of checking jq compatibility and, for library use, configuring loaders and managing query execution.

Platforms

gojq supports Linux, macOS, Windows, and self-hosted use. Its Go implementation is intended to be portable, and installation routes include package managers, source builds, and Docker images, giving developers several ways to fit it into command-line or server-side setups.

Who it's for

gojq is a strong fit for Go developers embedding jq-style queries in an application, especially when reusable compiled queries or custom functions and iterators are useful. It also suits command-line users who want free JSON querying with YAML input and output across the supported platforms. Teams with scripts that depend on exact jq behavior should first check the unsupported functions, flags, numeric extensions, key-order behavior, and regular-expression differences.

Pros and cons

Pros

  • Free, MIT-licensed CLI and library make it accessible for both direct use and Go integration.
  • YAML input and output support workflows that span JSON and YAML.
  • Arbitrary precision for core integer arithmetic avoids fixed-width limits in the covered operations.
  • Compiled queries, custom functions, and iterators give Go applications ways to tailor query execution.
  • Environment access and module loading are disabled by default in the library, giving callers control over whether to enable them.

Cons

  • It does not preserve object key order and lacks keys_unsorted and --sort-keys, which rules it out for workflows requiring those behaviors.
  • Some jq syntax, functions, and flags are unsupported or differ, including NaN, Infinity, leading-zero numbers, and some regular expressions.
  • Integer precision is not consistent across all math functions; floor and round convert integers to floating point.
  • Embedded queries may run indefinitely or emit endless values, so applications need execution limits.

Alternatives

jq is the direct alternative for users who want the original standalone tool and its binaries for Linux, macOS, and Windows; gojq is the choice when a Go library or YAML support matters.

Dadroit JSON Viewer suits readers who want a graphical JSON viewer with CSV or XML conversion and can work within its 50 MB file cap for free non-commercial use; its Standard plan is $98 per y.

BracketView fits users looking for a browser-accessible JSON service with a free plan that caps uploads at 5 MB and includes limited encrypted snapshots, AI actions, and webhook requests.

gron is a free alternative for users who prioritize a command-line binary with no runtime dependencies across Linux, Mac, Windows, and FreeBSD.

jaq is another free option for users who want an open-source command-line program and Rust library.

jless is a free MIT-licensed command-line tool for macOS and Linux.

jidoujisho is a free option for Android users.

JSON Crack is a free, open-source online tool for readers who prefer a browser extension or web interface and can work within its approximate 300 KB data capacity, which depends on data complexity and hardware.

Browse more options in JSON Tools.

Verdict

Choose gojq if you want a free, portable jq-style CLI with YAML support or need to embed configurable queries in a Go application. Its library controls and arbitrary-precision integer operations are compelling for Go-centered workflows. Look elsewhere when exact jq compatibility is essential, or when a library integration cannot accommodate the required input types and execution limits.

Verdict

gojq brings jq-style querying to Go with CLI and library use, plus YAML support. Check its documented compatibility and execution limits when replacing jq or embedding it in an application.

Questions

Does gojq cost anything?

The Free plan costs nothing. The software is open source under the MIT License.

Which platforms are supported?

The project lists Linux, macOS, Windows, and self-hosted use.

Can Go applications use gojq?

Yes. Applications can parse and run queries, compile queries for reuse, and configure custom functions and iterators.

Does gojq support YAML?

Yes. It supports YAML input and YAML output.

How does it differ from jq?

gojq does not preserve object key order, and it does not parse jq's NaN, Infinity, or leading-zero number extensions. Some functions, flags, and regular-expression syntax also differ.

Facts from gojq's own pages

Compatibility limits
gojq does not preserve object key order and lacks jq's keys_unsorted function and --sort-keys option. · github.com, 11 Oct 2026
Environment access
For library use, OS environment variables are inaccessible to queries by default for security reasons and can be enabled with a configured environment loader. · github.com, 4 Oct 2026
Execution limits
Library queries may emit infinitely many values or run without producing output, and the README recommends RunWithContext to limit execution time. · github.com, 4 Oct 2026
Install options
The project documents installation through Homebrew, mise, Zero Install, go install, and Docker. · github.com, 11 Oct 2026
JSON queries
The command applies jq queries to JSON input, including filtering, field selection, and updates. · github.com, 4 Oct 2026
Library integration
Go applications can parse and run queries with gojq, compile queries for reuse, and configure custom functions and iterators. · github.com, 4 Oct 2026
Library limits
The library requires query inputs to use []any for arrays and map[string]any for maps, and warns that queries can produce infinite results or run without producing output. · github.com, 11 Oct 2026
Library security
For library use, OS environment variables are inaccessible to queries by default; a caller can configure an environment loader. · github.com, 11 Oct 2026
License
The project is released under the MIT License. · github.com, 11 Oct 2026
Limits
gojq does not preserve object key order and therefore does not provide the keys_unsorted function or the --sort-keys option. · github.com, 4 Oct 2026
Module loading
The library's module feature is disabled by default and can be configured with a module loader. · github.com, 4 Oct 2026
Number precision
gojq supports arbitrary-precision integer calculations for addition, subtraction, multiplication, modulo, and divisible division. · github.com, 4 Oct 2026
Numbers
gojq supports arbitrary-precision integer calculations, while mathematical functions such as floor and round convert integers to floating-point numbers. · github.com, 11 Oct 2026
Other limits
The README lists unsupported jq features, including some functions and flags, JSON extensions such as NaN and Infinity, and some regular-expression features. · github.com, 11 Oct 2026
Portability
The README describes gojq as implemented purely in Go and completely portable. · github.com, 11 Oct 2026
Purpose
gojq is a pure Go implementation of the jq command-line JSON processor and can also be embedded as a library in Go products. · github.com, 11 Oct 2026
Queries
The CLI runs jq-style queries against JSON input and supports multiple input values. · github.com, 11 Oct 2026
Support
The project directs users to report bugs through its GitHub Issues page. · github.com, 11 Oct 2026
YAML
gojq supports YAML input with --yaml-input and YAML output with --yaml-output. · github.com, 11 Oct 2026

Where gojq stands on Freedom251

Look at these too