Text and JSON diff

Compare two versions of anything - a config file, a translation, a contract - and see the changed words inside each changed line rather than two walls of red and green. What you paste stays in this tab.

  • DetailLine and word level
  • ExportUnified diff
  • Your documentsNever leave the tab

Before

After

Changes

3 changed, 2 added, 1 removed.

Changed
3
lines rewritten
Added
2
new lines
Removed
1
deleted lines
Unchanged
4
lines kept
1{
2 "name": "checkout-service",
3 "version": "2.4.0",
3 "version": "2.5.1",
4 "retries": 3,
4 "retries": 5,
5 "timeoutMs": 5000,
6 "regions": ["eu-west", "me-south"],
6 "regions": ["eu-west", "me-south", "us-east"],
7− "notes": "Falls back to the queue when the gateway is down."
7+ "featureFlags": { "instantRefund": true },
8+ "notes": "Falls back to the queue when the gateway is unavailable."
8}
Compared in this tab - nothing was uploaded.

Why the word marks matter

A line diff says the line changed; a word diff says which word. On a config file or a translation that is the whole answer - and it is why a changed line is shown twice here, once with what left and once with what arrived.

When lines are not paired

Two lines that sit next to each other are not necessarily a rewrite of one another. When a deleted line and an added one share too little, they are shown separately rather than as one row where every word is marked - which reads as noise.

For JSON, compare by path instead

A text diff on JSON reports a reordered key as a change and a re-indentation as a hundred. The JSON toolkit compares by path - one line per changed value - which is usually what you want for a payload rather than for a file.

Frequently asked questions

How do I compare two texts online safely?
Use a comparison that runs in the browser. What people compare is usually a config file, a contract or a translation, and none of those should be posted to a server to find a one-word change. This page does the whole comparison in the tab.
What is a unified diff?
The format git and patch use: a few lines of context around each change, with removed lines marked - and added lines marked +. It is what to paste into a pull request or an issue, and this page exports it.
Why are some lines shown as a delete and an add rather than a change?
Because they are not a rewrite of one another. When a removed line and an added line share too little text, pairing them produces a row where nearly every word is marked, which reads as noise. Below that threshold they are shown separately.
Should I use a text diff for JSON?
For a file, yes. For an API payload, comparing by path is better - a text diff reports a reordered key as a change and a re-indentation as a hundred. The JSON toolkit on this site compares by path instead.