Skip to content
CALZYRA— TOOLS THAT EMPOWER —
FinanceInvestmentsHealthMathBlog
CALZYRA— TOOLS THAT EMPOWER —

Practical calculators and online tools, made to be simple and useful.

Popular Categories

  • Finance
  • Health & Fitness
  • Mathematics
  • Physics
  • Construction
  • Conversion

Finance Tools

  • Loan Calculators
  • Investment Calculators
  • Compound Interest
  • SIP Calculator
  • ROI Calculator
  • CAGR Calculator

Top Calculators

  • Mortgage Calculator
  • BMI Calculator
  • Percentage Calculator
  • Calorie Calculator
  • Tip Calculator

Company

  • About Us
  • Blog
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 Calzyra. All rights reserved.

Free tools for everyday calculations, learning, and practical work.
HomeDeveloper ToolsJSON ToolsJSON Diff Tool

JSON Diff – Compare Two JSON Files Online

Compare two JSON documents online free. Paste JSON A and JSON B into this JSON Diff tool and get every added, removed, changed and type-changed value back with its exact path — no line-by-line squinting required.

Nothing is uploaded and no sign-up is needed: both documents are parsed and compared locally in your browser, so your data never leaves your device.

Ctrl+Enter to compare
json
1
2
3
4
5
{
  "name": "John",
  "age": 30,
  "city": "Lahore"
}
5 lines53 chars8 wordsjson
json
1
2
3
4
5
{
  "name": "John",
  "age": 31,
  "country": "Pakistan"
}
5 lines58 chars8 wordsjson

JSON Differences

No comparison has been run yet. Paste two JSON documents and press Compare.

The differences appear here

Paste your original JSON into JSON A and the new JSON into JSON B, then press Compare. Every added, removed and changed value is listed with its exact path.

Comparing reads both documents only – neither input is modified.

Related JSON tools

JSON Validator – Validate JSON Online

Validate JSON syntax and find errors

JSON Schema Validator

Validate JSON against schema

JSON Formatter

Format and beautify JSON into readable JSON

JSON Beautifier

Beautify JSON for easy reading

JSON Tree Viewer

View JSON as an expandable tree

JSON Flattener

Flatten nested JSON to flat keys

JSON to CSV Converter

Convert JSON arrays to CSV rows and columns

JSON to YAML Converter

Convert JSON to indented YAML

JSON to XML Converter

Convert JSON to indented XML

Both JSON documents are parsed in your browser, so nothing is uploaded.

What is a JSON diff tool?

A JSON diff tool answers one question precisely: what changed between these two documents? It parses both documents and walks the values together, then reports every addition, removal, change and type change with the path where it lives - user.address.city, settings.theme, skills[2]. The result is a short, readable list of real changes rather than two walls of text to compare by eye.

That is the job you need whenever JSON changes: comparing two API responses to see what a backend release altered, checking a config file before and after an edit, confirming that a migration produced the data you expect, or reviewing a pull request that only touches a JSON fixture.

Nothing is uploaded and no account is needed. Both documents are parsed and compared locally in your browser, so your data stays on your machine - which matters when the JSON is a customer record, a log export or an internal API response.

How to compare two JSON documents

The workflow is three steps: paste both documents, compare, read the result.

  1. 1Paste the original JSON into the JSON A panel and the changed JSON into the JSON B panel. Load Example fills both panels with a pair that demonstrates additions, removals and changes.
  2. 2Press Compare. Both documents are parsed, checked and then walked together, so every difference is found at its exact path.
  3. 3Read the differences in the result panel. Each entry shows the path and the value on each side, grouped by whether it was added, removed or changed.
  4. 4Copy the result as text to keep a record of exactly what changed, or fix a syntax error and compare again if a document did not parse.

The comparison happens entirely in your browser. There is no upload step, no account and no usage limit, so it is equally usable for a two-line snippet and for a multi-megabyte API response.

JSON diff example

The two objects below differ in three ways. The comparison reports that age changed, that city was removed and that country was added - each with its exact path, without you having to read either document line by line.

Because the comparison is semantic, formatting and key order never show up as differences. Only changes to the data itself appear in the result.

JSON A – Original
{
  "name": "John",
  "age": 30,
  "city": "Lahore"
}
JSON B – Updated
{
  "name": "John",
  "age": 31,
  "country": "Pakistan"
}
Result as text
JSON differences: 3 found (1 added, 1 removed, 1 changed)

Changed: age: 30 -> 31
Removed: city = "Lahore"
Added: country = "Pakistan"

Unchanged: 1 value matched on both sides

Semantic diff vs text diff

A text diff is the tool you use for source code, and it works line by line. Pointed at JSON, it has no idea what a line means: reformat one document and every line looks changed, reorder the keys of an object and the whole block moves, and a value that changed from 1 to "1" looks like a minor edit rather than a type change.

A semantic diff parses the JSON first, so it compares values rather than text. It knows that { "a": 1, "b": 2 } and { "b": 2, "a": 1 } are the same document, it can point at user.address.city rather than at line 42, and it can report a type change as a type change.

AspectJSON Diff (semantic)Text Diff (line-by-line)
Unit of comparisonParsed values, matched by key and array indexRaw lines of text
Key orderIgnored - reordered keys are not a changeA reorder rewrites the whole block
FormattingIgnored - whitespace and indentation never matterIndentation changes show up as differences
Location reportedA data path such as user.address.cityA line number
Type changesReported separately, e.g. number 1 -> string "1"Looks like a small text edit
ArraysCompared by index, so inserts and drops are preciseAn inserted item rewrites every later line
Best forAPI payloads, config files, data fixturesSource code

In practice a JSON diff and a text diff answer different questions. Reach for the text diff when comparing source code line by line, and for the semantic JSON diff whenever the data is structured and you care about what changed rather than which lines moved.

How nested objects and arrays are compared

Objects are compared key by key. A key that only exists in JSON B is reported as added, a key that only exists in JSON A is reported as removed, and a key that exists in both is compared recursively, however deep it sits. That is why a one-value change inside a deeply nested object produces a single, precise entry instead of a large block of noise.

Arrays are compared item by item at the same index, so an item appended to the end is an addition at that index and a shortened array is a removal at the trailing indexes. Values that are present and equal on both sides are counted and summarised as the unchanged total, so you can see at a glance how much of the document actually moved.

When a JSON diff is the right tool

A JSON diff is the right choice when the two documents are meant to describe the same thing and you need to know how they differ: API responses before and after a deploy, a configuration file before and after an edit, an exported dataset compared with a known-good fixture, or two similar payloads from different environments.

It is the wrong choice when you actually want to combine the documents rather than compare them - that is a merge, not a diff - or when you are diffing source code, where a line-based text diff remains the better tool. For structured data, comparing the parsed values is what makes the answer trustworthy.

Related JSON tools

Comparing two documents is only one step in a JSON workflow. These are the other Calzyra tools you are most likely to reach for next.

  • Not sure which side is valid JSON, or where it breaks?JSON Validator
  • Need to make both documents readable before you compare them?JSON Formatter
  • Need one document beautified with a consistent indent?JSON Beautifier
  • Need to explore one document as collapsible nodes?JSON Tree Viewer
  • Need a flat key-value view of the same nesting?JSON Flattener
  • Need to turn a document into rows and columns?JSON to CSV Converter
  • Need YAML output instead?JSON to YAML Converter
  • Need an XML document instead?JSON to XML Converter

Frequently Asked Questions

What is a JSON diff tool?▾

A JSON diff tool compares two JSON documents and reports what changed between them. Instead of showing the two files side by side and leaving you to spot the difference, it walks the parsed data and lists every addition, removal, change and type change together with the exact path where it happened, such as user.address.city or skills[2]. That makes it the quick way to answer questions like "what did this API response change between two calls?" or "what did this config edit actually do?".

How do I compare two JSON files?▾

Paste the original document into the JSON A panel and the changed document into the JSON B panel, then press Compare. The differences are listed in the result panel with the path and the two values for each one, and a copyable text summary is available under the difference list. Comparing also runs automatically as you type, so the button is a shortcut rather than a requirement.

Is this JSON diff tool free?▾

Yes. It is free to use with no sign-up, no usage limit and no watermark. Because both documents are parsed in your browser, there is also no upload size limit, which makes it usable for large API responses and configuration files.

What is the difference between a semantic diff and a text diff?▾

A text diff compares the two documents line by line, so it only knows that some line moved or that the indentation changed. A semantic diff compares the parsed values, so it can report that user.address.city changed from "Lahore" to "Karachi" even when the line moved, that a key was added, or that a value changed from the number 1 to the string "1". This tool is a semantic diff, which is why it finds real changes in reordered or reformatted documents.

Does key order or formatting affect the comparison?▾

No. Both documents are parsed before they are compared, so whitespace, indentation and the order of keys in an object are ignored. Two documents that contain the same data in a different key order are reported as identical. The order of items in an array does matter, because an array is an ordered list and moving an item is a real change.

How are arrays compared?▾

Arrays are compared item by item at the same index. An item appended to the end is reported as an addition at that index, and a shorter array is reported as a removal at the indexes the longer one still has, so the result is a short list of real changes rather than a shifted run of unrelated lines. Comparing by index is deliberate: it keeps the report readable and makes it obvious which positions were inserted, changed or dropped.

Does the diff detect values that changed type?▾

Yes. When the same path holds different JSON types on each side, the difference is reported as a type change with the value and the type on both sides, for example 1 (number) becoming "1" (string). That is kept separate from an ordinary change on purpose, because 1 and "1" are a common source of bugs when comparing API payloads, and a plain text diff would not make the distinction.

What happens if one of the documents is not valid JSON?▾

The input is parsed with a strict JSON parser before anything is compared, and if it does not parse the tool reports the first syntax error with its message, line and column - exactly the position the JSON Validator shows. No diff is produced in that case, and neither input is changed, so you can fix the document in place and compare again.

Is my JSON uploaded anywhere?▾

No. Both documents are parsed and compared entirely in your browser, so nothing is sent to a server. That matters when the JSON is a customer record, a log export or an internal API response, and it also means there is no upload size limit and no account to create.

Can I copy the list of differences?▾

Yes. The result panel includes a copyable text summary with one line per difference - added, removed, changed or type changed - followed by a count of the values that matched on both sides. That makes it easy to paste the result into a ticket, a commit message or a chat.

JSON Tools

JSON FormatterJSON Validator – Validate JSON OnlineJSON Minifier – Minify JSON OnlineJSON BeautifierJSON Tree ViewerJSON to CSV ConverterJSON to XML ConverterJSON to YAML ConverterJSON Diff ToolJSON Merge ToolJSON FlattenerJSON UnflattenerJSON Schema ValidatorJSON Path TesterJSON SorterJSON Pretty PrintJSON Escape ToolJSON Unescape ToolJSON to TypeScript InterfaceJSON to TypeScript Interface GeneratorJSON Query ToolJSON Compare ToolJSON Statistics CalculatorJSON Size CalculatorJSON Optimizer

About this diff tool

  • Parses both documents first, so formatting and key order never appear as differences.
  • Reports every change with its exact path, such as user.address.city or skills[2].
  • Compares objects key by key and arrays item by item, so an appended item is one precise entry.
  • Flags type changes such as the number 1 becoming the string "1" instead of treating them as a small edit.
  • Parses the JSON first and reports the line and column of a syntax error instead of producing a misleading diff.
  • Runs entirely in your browser – no uploads.