Home / JSON tools / JSON diff viewer

JSON Diff Viewer

See two JSON documents side by side, with line numbers and the changed lines and characters highlighted. Fold away the unchanged parts.

Options

Result

A visual view of the differences

The viewer shows the two documents next to each other. Lines that are the same are shown plainly, lines that were removed are red on the left, lines that were added are green on the right, and lines that changed are shown in both colors with the changed characters marked. It works like the diff view in a code review, but it is built for JSON.

Both sides are put in the same shape first

Before the lines are compared, both documents are printed with the same indentation, and the keys are sorted. Without that, two documents with the same data could look completely different in a line comparison. If you want to see the keys in their original order, turn off Sort keys in the viewer.

Views

  • Side by side: the left document, the right document and line numbers for each.
  • Unified: one column, with a minus for removed lines and a plus for added lines, like the output of git diff.
  • Changes: the list of differences with paths, which is quicker to scan when only a few values changed.

Fold unchanged lines

Tick Show only changes to hide the lines that did not change, apart from three lines of context around each difference. This is useful for large documents where only a few places differ. The hidden stretches are shown as a line that says how many lines were left out.

Tips

  • Arrays are compared in order, unless you tick Ignore array order, which also sorts the items in the view so that the lines can be compared.
  • Ignored keys are taken out of both sides before the view is made.
  • Very long documents are limited to the first 5000 lines in the view. The list of changes always covers everything.

For a plain list of differences, see JSON diff, and for the comparison options, see JSON compare. You can also open files with compare two JSON files.

Frequently asked questions

What is a JSON diff viewer?

A tool that shows two JSON documents side by side and highlights the lines and characters that differ.

Why are the keys sorted in the view?

So that the same data always has the same layout. Otherwise a different key order would show up as many changed lines. You can turn sorting off.

Can I see only the changed lines?

Yes. Tick Show only changes to fold the unchanged lines and keep three lines of context.

Is there a unified view like git diff?

Yes. Open the Unified tab for a single column with plus and minus lines.