# JSON Diff - Compare Two JSON Documents Online and Generate JSON Patch

> Free online JSON diff: compare two documents ignoring key order, see added, removed and changed paths with old and new values, and export an RFC 6902 patch.

- URL: https://qilingtools.com/en/json-diff
- Category: Developer Tools (https://qilingtools.com/en/dev)
- Tags: [Developer](https://qilingtools.com/en/tags/dev), [Data Formats](https://qilingtools.com/en/tags/data)
- Last updated: 2026-10-26
- Price: Free, no sign-up
- Privacy: Runs locally in the browser; files are never uploaded

A plain text diff flags every change in key order or indentation, which is mostly noise for JSON. This tool parses both documents and compares them structurally: object key order is always ignored, 1 and 1.0 are equal, and only real content changes are reported. Arrays are compared in order by default and aligned with a longest-common-subsequence match, so inserting one element does not mark everything after it as changed; tick Ignore array order to compare arrays as multisets and see only added or removed elements. View the result three ways: a diff tree showing changed paths in context, a change list with $.a.b[0]-style paths plus old and new values and one-click path copying, or an RFC 6902 JSON Patch of add / remove / replace operations that turns the left document into the right one when applied in order. Great for API responses, config files, database exports and test snapshots.

## How to use

1. Paste the old JSON on the left and the new JSON on the right
2. Optionally tick Ignore array order
3. Review the diff tree, change list or JSON Patch and copy paths or the patch

## Features

- Semantic comparison that ignores key order and formatting
- LCS array alignment, so insertions do not cascade
- Optional order-insensitive array comparison
- Diff tree and change list with paths and old/new values
- RFC 6902 JSON Patch output
- Syntax errors with line and column
- Runs locally; nothing is uploaded

## FAQ

### How is this different from a text diff?

A text diff compares characters line by line, so different key order, indentation or spacing all show up as changes. JSON diff parses first and compares structure: {"a":1,"b":2} and {"b":2,"a":1} are identical, and only changed values and added or removed keys are listed.

### When should I ignore array order?

When an array represents an unordered collection — tags, permissions, or records returned in no guaranteed order. With the option on, [1,2,3] and [3,1,2] are equal and only extra or missing elements are reported. Leave it off when order matters, such as a list of steps.

### What is JSON Patch and how do I use it?

JSON Patch (RFC 6902) is a standard format for describing changes to a JSON document as add, remove and replace operations addressed with JSON Pointer paths like /servers/0/port. Libraries in most languages can apply it, and it is common in HTTP PATCH APIs. Applying the generated patch in order to the left document produces the right one.

### Is my data uploaded?

No. Parsing and comparison run entirely in your browser, so API payloads and configuration secrets never leave your computer.

## Related tools

- [JSON Formatter](https://qilingtools.com/en/json): Free online JSON formatter: beautify or minify, validate with the exact line and column of any error, browse a collapsible tree, sort keys and escape strings.
- [Base64 Encode/Decode](https://qilingtools.com/en/base64): Free online Base64 encoder and decoder: UTF-8 safe, optional URL-safe variant, convert text to Base64 and back in real time. Processed locally, never uploaded.
- [URL Encode/Decode](https://qilingtools.com/en/url-encode): Free online URL encoder and decoder with encodeURIComponent and encodeURI modes. Escapes Chinese, spaces and special characters. Real-time and local, no upload.
- [JWT Decoder](https://qilingtools.com/en/jwt): Free online JWT decoder: decode the header and payload of a JSON Web Token, show expiry and issued-at times, all locally without uploading the token.
- [Timestamp Converter](https://qilingtools.com/en/timestamp): Free online Unix timestamp converter: convert timestamps and dates, auto-detect seconds or milliseconds, and show local, UTC, ISO 8601 and relative time.
- [Hash / Checksum](https://qilingtools.com/en/hash): Free online hash calculator: SHA-1, SHA-256, SHA-384 and SHA-512 of text or any file through the browser crypto API. Files never leave your device.
- [UUID Generator](https://qilingtools.com/en/uuid): Free online UUID generator: create RFC 4122 UUID v4 in bulk with a cryptographic RNG. Options for uppercase, no hyphens and braces, with one-click copy.
- [Base Converter](https://qilingtools.com/en/base-convert): Free online number base converter: convert between binary, octal, decimal, hexadecimal and any base 2–36. Uses BigInt for huge integers, computed locally.
