JSON Diff

JSON Diff

Compare two JSON documents with line, word, character, or unified patch diff modes. Normalize JSON before comparison to focus on structural changes instead of whitespace and key-order noise.

json
diff
compare
Share this tool:
Quick Presets
Sample JSON pairs to compare quickly
Compare JSON & Settings
Paste two JSON documents and inspect the differences.
Original JSON
Paste the original JSON document on the left.
Chars: 0
Lines: 0
Bytes: 0
Updated JSON
Paste the updated JSON document on the right.
Chars: 0
Lines: 0
Bytes: 0
How it works: This tool compares two JSON documents locally. You can diff the raw text or normalize both payloads first so the comparison focuses on structure instead of whitespace and key-order noise.

What is JSON Diff?

The JSON Diff tool compares two JSON documents and highlights what changed between them. It supports a normalized comparison mode that parses both inputs and reformats them before diffing, so differences in key order and whitespace are ignored. You can choose between line-level, word-level, character-level, and unified patch output formats. All processing happens in the browser.

How does JSON Diff work?

This tool takes two JSON inputs, optionally parses and reformats them to a canonical form, then runs a diff algorithm to identify additions, removals, and modifications. Normalized mode reduces noise from formatting differences. Raw mode compares the text as-is. The output shows added and removed counts and displays the diff with color coding.

Key Features

  • Line, word, character, and unified patch diff modes
  • Normalized comparison ignores key order and whitespace
  • Configurable indentation during normalization
  • Optional key sorting for stable comparison
  • Added and removed change counts
  • Copy diff output to clipboard
  • Download diff as text file
  • Highlights added, removed, and changed fields with deep object comparison

Common Use Cases

When and why you might need this tool
  • Reviewing API payload changes

    Compare two API request or response payloads to see exactly what fields changed between versions.

  • Auditing configuration file changes

    Diff two JSON config files to identify settings that were added, removed, or modified.

  • Comparing test fixtures

    Check differences between expected and actual JSON outputs in test results.

  • Filtering out formatting noise

    Use normalized mode to ignore whitespace and key order differences and focus on real data changes.

How to Use This Tool

Step-by-step guide to get the best results
1

Paste both JSON documents

Enter the original JSON on the left and the updated JSON on the right.

2

Choose comparison mode

Select raw (literal text comparison) or normalized (parse, reformat, then compare).

3

Select diff format

Pick line, word, character, or unified patch output.

4

View the diff

The tool shows the differences with color coding and a summary of changes.

Pro Tips

  • 1

    Use normalized mode when you want to ignore whitespace and key order differences.

  • 2

    Line diff is the most readable format for reviewing API or config changes.

  • 3

    Sort keys during normalization for a more stable comparison.

  • 4

    Unified patch mode produces output similar to git diff.

Frequently Asked Questions

What is normalized JSON diff?

JSON diff normalized mode parses both JSON documents and reformats them to a consistent style before comparing. This filters out noise from key reordering and whitespace differences.

When should I use raw text diff?

Use raw text diff when formatting itself matters, or when you want to see every literal character-level difference exactly as pasted.

What diff modes are available?

The tool supports line diff, word diff, character diff, and unified patch output. Line diff is the best default for most review workflows.

Is my JSON uploaded to a server?

No. All comparison happens in your browser using JavaScript. The JSON never leaves your device.

Can I compare JSON with reordered keys?

Yes. Use normalized comparison with key sorting to ignore key order differences and focus on the actual data.