{jsonbody.com}

Diff Checker (Text, JSON & Code)

Find the differences between two texts, JSON bodies or code snippets. JSON ignores key order and lists each change by path, and changed words are highlighted. Free.

Compare text, JSON and code online

This diff checker shows exactly what changed between two versions. Paste the original on the left and the changed version on the right, and press Find Differences. Lines are lined up side by side, and within a changed line only the changed words are highlighted, so a one-character edit stands out even in a long line.

It is useful for comparing API responses between environments, reviewing a config change, checking a snippet against an earlier version, or finding out why something that worked yesterday no longer does.

Three comparison modes

  • Text compares line by line, with options to ignore whitespace and upper or lower case.
  • JSON understands the data. It ignores formatting and, by default, key order, then lists every change by its path.
  • Code keeps line numbers and can ignore re-indentation, so a moved block does not hide the one real edit inside it.

Example: comparing two JSON bodies

A plain text diff would mark nearly every line here, since the keys have moved. JSON mode reports only the two things that actually changed.

Two API responses and the result
Original: { "id": 7, "plan": "free", "name": "Asha" }
Changed:  { "name": "Asha", "id": 7, "plan": "pro", "active": true }

changed  $.plan     "free" -> "pro"
added    $.active   true

How the comparison works

The tool uses the Myers diff algorithm, the same family of method behind git diff. It finds the smallest set of added and removed lines that turns one side into the other. Removed lines that sit next to added lines are paired up and shown as a change. Array items in JSON mode are compared by position, so an item inserted at the start shows the later items as changed too. If that happens, look at the side-by-side view to see what really moved.

Which compare tool to use

Use this page when you switch between text, JSON and code, or when you want word-level highlights and a list of JSON paths. Our Text Compare page offers a separate side-by-side view with jump markers, which suits long documents. Before comparing SQL or XML, run both sides through the matching formatter, so that layout differences do not get in the way. Your text stays in your browser the whole time, which matters when you compare production configs or API responses that may contain customer data. Even so, avoid pasting live secrets on shared computers.

Frequently Asked Questions

How do I compare two JSON objects and ignore key order?

Choose the JSON tab and keep Ignore key order turned on. The keys are sorted on both sides before comparing, and the path table only lists real changes.

Can I ignore whitespace when comparing code?

Yes. Turn on Ignore whitespace in the Text or Code tab, and lines that differ only in spacing or indentation count as the same.

Why does JSON mode report an error?

One side is not valid JSON. The message says which side and where the problem is. Use the Text tab if you need to compare it as it is.

Is there a size limit?

There is no upload limit, since everything runs on your device. The view shows up to 5000 lines at a time, and Show only changes helps with long files.