Why compare JSON files in the browser?

JSON is everywhere: REST API responses, configuration files, exported data from apps, database snapshots, and feature flag payloads. When two versions of a JSON document differ, you need a fast way to spot exactly what changed — without copying sensitive data to an online service that stores or logs your input.

A client-side diff tool solves this. Your JSON never leaves your browser tab. The comparison runs entirely on your device using JavaScript, so it is safe for credentials, internal API responses, or confidential config files.

Common situations where this is useful

  • API debugging: Compare a response from staging against production to find unexpected field changes.
  • Config management: Spot what changed between two versions of an appsettings.json or .env.json file.
  • Data exports: Check whether a database export matches an expected baseline.
  • Feature flags: Verify that only the intended toggles changed between two flag payload snapshots.
  • Dependency review: Compare package-lock.json files before and after an npm update.

Step-by-step: how to diff two JSON files

  1. Open the diff tool. Go to the Universal Diff Tool on LightDarkTools. No account or login is needed.
  2. Paste or upload your first JSON file into the left panel labelled Original. You can paste JSON directly or click Upload to load a .json file from your device.
  3. Paste or upload your second JSON file into the right panel labelled Modified.
  4. Click Compare. The tool highlights additions in green and deletions in red, line by line.
  5. Switch between Unified and Split view using the toggle at the top to see the diff in the format that suits you.
Tip: Enable Syntax Highlighting in the controls bar to colour-code JSON keys and values. This makes it easier to scan large payloads for the specific field that changed.

What about deeply nested JSON?

The diff tool works on the raw text of your JSON, which means deeply nested structures are compared line by line. To make the output easier to read, consider pretty-printing your JSON before pasting it in. Most browsers let you do this in the console with JSON.stringify(obj, null, 2), or you can paste the JSON into the tool and it will auto-format if the input is valid.

Ignoring whitespace differences

If your two JSON files are structurally identical but differ only in indentation or trailing spaces, check the Ignore Whitespace option in the toolbar. This filters out formatting-only differences so you can focus on actual data changes.

Does any data get sent to a server?

No. The Universal Diff Tool on LightDarkTools is fully client-side. The comparison logic runs in your browser using JavaScript, and nothing is transmitted to a server. This makes it safe for comparing internal configs, API secrets, or any sensitive structured data.