# @jsonjoy.com/json-equal

> Deep equality check for JSON values

Latest version **18.30.0** (published 2026-09-08) · AGPL-3.0-only license · 0 weekly downloads

## Install

```sh
npm install @jsonjoy.com/json-equal
pnpm add @jsonjoy.com/json-equal
yarn add @jsonjoy.com/json-equal
bun add @jsonjoy.com/json-equal
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 18.30.0 |
| Published | 2026-09-08 |
| First published | 2026-02-22 |
| Weekly downloads | 0 |
| License | AGPL-3.0-only |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10.0 |
| Dependencies | 1 |
| Unpacked size | 133 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 1091 |
| Author | streamich |
| Maintainers | json-joy-team, streamich |
| Keywords | json, deep-equal, deep-equality, json-equal, json-equality, fast-deep-equal, fast-equals, lodash.isEqual, underscore.isEqual, equal, is-equal, compare |

## Links

- npm: https://www.npmjs.com/package/@jsonjoy.com/json-equal
- Repository: https://github.com/streamich/json-joy
- Homepage: https://github.com/streamich/json-joy/tree/master/packages/json-equal
- Issues: https://github.com/streamich/json-joy/issues
- Funding: https://github.com/sponsors/streamich
- npm.io page: https://npm.io/package/@jsonjoy.com/json-equal

## Dependencies (1)

- [@jsonjoy.com/codegen](https://npm.io/package/@jsonjoy.com/codegen.md) 18.30.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 18.30.0 (latest) — 2026-09-08
- 18.28.0 — 2026-06-02
- 18.24.0 — 2026-05-15
- 18.23.0 — 2026-05-14
- 18.22.0 — 2026-05-14
- 18.21.0 — 2026-05-10
- 18.20.0 — 2026-05-09
- 18.19.0 — 2026-05-07
- 18.18.0 — 2026-05-07
- 18.17.0 — 2026-05-07
- 18.16.0 — 2026-05-06
- 18.15.0 — 2026-04-18
- 18.14.0 — 2026-04-16
- 18.13.0 — 2026-04-15
- 18.12.0 — 2026-04-12
- … 9 more at https://npm.io/package/@jsonjoy.com/json-equal/versions

## README

# json-equal

This library contains the fastest JSON deep comparison algorithms.

- `deepEqual` &mdash; deep comparison of JSON objects. Faster than `fast-deep-equal` and
  `fast-equals` packages.
- `$$deepEqual` &mdash; if the comparison JSON object is known in advance, this function
  can pre-compile a javascript function for comparison, which is about an order of magnitude
  faster than `deepEqual`.


## Reference


### `deepEqual`

```ts
import {deepEqual} from 'lib/json-equal/deepEqual';

deepEqual(a, b); // true/false
```


### `$$deepEqual`

```ts
import {$$deepEqual} from 'lib/json-equal/$$deepEqual';

const js = $$deepEqual(a);
const fn = eval(js);

fn(b); // true/false
```


## Benchmarks

```
node benchmarks/json-equal/bench.deepEqual.js
json-equal (v1) x 873,303 ops/sec ±0.34% (96 runs sampled), 1145 ns/op
json-equal (v2) x 664,673 ops/sec ±0.44% (97 runs sampled), 1504 ns/op
json-equal (v3) x 710,572 ops/sec ±0.15% (100 runs sampled), 1407 ns/op
fast-deep-equal x 620,740 ops/sec ±0.34% (101 runs sampled), 1611 ns/op
fast-equals x 812,390 ops/sec ±0.11% (101 runs sampled), 1231 ns/op
lodash.isEqual x 182,440 ops/sec ±0.18% (98 runs sampled), 5481 ns/op
json-equal/deepEqualCodegen x 6,161,316 ops/sec ±0.30% (101 runs sampled), 162 ns/op
json-equal/deepEqualCodegen (with codegen) x 47,583 ops/sec ±0.11% (100 runs sampled), 21016 ns/op
Fastest is json-equal/deepEqualCodegen
```

---
_Source: https://npm.io/package/@jsonjoy.com/json-equal · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
