Home › Developer Tools › JSON Compare

JSON Compare

Paste two JSON documents to see exactly what changed: every added, removed and modified value with its path. Key order and formatting are ignored, and you can also ignore array order or match array items by an id.

Last updated:

Advertisement
Advertisement

How to use the JSON Compare

  1. Paste the original JSON on the left and the changed JSON on the right, or upload two .json files.
  2. Read the summary: the counts of added, removed and changed values appear instantly.
  3. Browse the differences. Each row shows the path (such as $.users[2].email) and the old and new value. Use the filters to show only one kind.
  4. Set options if needed: ignore array order, match array items by a key like id, ignore keys like updatedAt, or ignore string case.
  5. Switch views to Side by side for highlighted lines, or JSON Patch to copy a patch that turns the left document into the right one.

How the JSON comparison works

Both documents are parsed first, so the tool compares data, not text. Then it walks the two trees side by side:

  • Objects are compared key by key. A key only on the left is removed, a key only on the right is added. Key order never matters.
  • Arrays are compared with a longest-common-subsequence algorithm, the same idea used by text diff tools. Inserting one item at the start is reported as one added item, not as every item changing. Arrays of records that all have a unique id (or _id, uuid, key, sku, code) are matched by that field automatically; set your own field in Match array items by key.
  • Values (strings, numbers, booleans, null) are changed when they differ. If the type differs, for example 1000 became "1000", it is reported as a type change, a common source of API bugs.

Reading JSON paths

PathMeaning
$The whole document (root)
$.owner.emailThe email key inside the owner object
$.tags[3]The fourth item of the tags array (indexes start at 0)
$.users[id=2]The item in users whose id is 2 (when matching by key)
$["first name"]A key that contains spaces or special characters
/users/0/emailJSON Pointer (RFC 6901), the path style used in JSON Patch

Common uses

  • API testing: compare a response before and after a deploy. Add updatedAt, requestId to Ignore keys so fields that always change do not hide real regressions.
  • Config drift: compare package.json, tsconfig.json or deployment configs between branches or environments.
  • Data migrations: match records by id to see exactly which records changed, appeared or disappeared.
  • Sync and patches: copy the JSON Patch to send only the changes to a server that supports RFC 6902.

Frequently asked questions

How do I compare two JSON files?

Paste or upload the first file on the left and the second on the right. The tool parses both and compares them value by value, so differences in whitespace, indentation or key order are ignored and only real data changes are listed.

Does key order matter in JSON?

No. In JSON, an object is an unordered set of name/value pairs, so {"a":1,"b":2} and {"b":2,"a":1} are the same data. Array order does matter by default, because [1,2] and [2,1] are different lists, but you can choose to ignore it.

What does 'match array items by key' do?

Arrays of objects such as users or products are often reordered or have items inserted. If every item has a unique field like id, the tool pairs items with the same id and compares them, instead of comparing by position. Changes are then shown as $.users[id=42].email.

What is a JSON Patch?

JSON Patch (RFC 6902) is a standard list of operations, such as add, remove and replace, with JSON Pointer paths like /users/0/email. Applying the generated patch to the left document produces the right document exactly.

Is my JSON uploaded to a server?

No. Both documents are parsed and compared with JavaScript in your browser, so API responses, configs and other private data never leave your device.

Why are 1 and 1.0 shown as equal?

In JSON both are the same number. The comparison works on parsed values, so 1, 1.0 and 1e0 are equal, and "1" (a string) is reported as a type change from number to string.

How large can the JSON files be?

Documents of several megabytes work. Very large arrays use a faster position-based comparison, and the side-by-side view is limited for huge files to keep the page responsive.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

JSON FormatterBeautify, minify and validate JSON, with a collapsible tree view.Code Diff CheckerCompare two code files side by side or unified, with syntax colors and changes highlighted.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.Text CompareFind the differences between two texts.Compare PDFCompare two PDF files and see added, removed and changed text side by side, page by page.JSON Schema ValidatorValidate JSON against a JSON Schema (draft-07, 2019-09, 2020-12) with clickable error paths.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.CSV CleanerClean messy CSV in one click: trim spaces, drop empty rows and columns, fix headers, dedupe.CSV VLOOKUP ToolJoin two CSV or Excel files on a key column like VLOOKUP, with left, inner and full joins.Remove Duplicates in ExcelFind and remove or highlight duplicate rows in XLSX or CSV files by the columns you choose.GeoJSON ViewerView GeoJSON on a map, inspect and edit properties, validate against RFC 7946 and export.GPX ViewerOpen GPX tracks on a map with distance, elevation profile, moving time, speed and splits.JSON Repair ToolFix broken JSON automatically: trailing commas, quotes, comments, truncated data, with a diff.Karnaugh Map SolverSolve 2–6 variable K-maps: click cells or enter minterms to get the minimal SOP or POS with groups.Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.Parquet File ViewerOpen Apache Parquet files in your browser: schema, rows, filters and CSV or JSON export.Query CSV with SQLRun SQL on CSV, Excel, JSON and Parquet files in your browser with DuckDB. Join and export.Online Serial MonitorTalk to Arduino, ESP32 and USB serial devices in your browser: log, send, plot and save.Split Excel FileSplit an Excel sheet into several files by row count or by each value in a column, as ZIP.SQL Create Table GeneratorDefine columns, keys, defaults and indexes; get CREATE TABLE SQL for MySQL, Postgres and more.SQL IN Clause GeneratorTurn a pasted list into a SQL IN ('a','b') clause with quoting, dedupe and 1,000-item chunks.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.CSV to YAML ConverterConvert CSV rows to a YAML list of mappings with type inference and delimiter detection.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.File to C ArrayConvert any file into a C or C++ byte array header, like xxd -i, with const and PROGMEM options.Image to C ArrayConvert images to monochrome, RGB565 or RGB888 C arrays for OLED, LCD and TFT displays.JSON Merge ToolDeep-merge two or more JSON objects with array concat, replace or union and a conflict rule.JSONL to CSV ConverterConvert JSON Lines / NDJSON to CSV with flattened columns; streams large files locally.PHP Unserialize OnlineDecode PHP serialize() strings to JSON, a tree or print_r, and serialize JSON back to PHP.SQL Dialect ConverterTranslate SQL between MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and more.
See all 129 Data & File Format Converters →