Home › Developer Tools › Text Diff / Compare
Developer Tool

Text Diff / Compare

Paste two versions of a text and see exactly what was added, removed and changed.

✓
100% Free to Use Your text is compared in your browser
0 lines · 0 characters
0 lines · 0 characters

Up to 300,000 characters and 20,000 lines per side.

Ctrl or ⌘ + Enter compares.

Differences

Paste text into both boxes to compare, or try an example.

How to Use the Text Diff / Compare

  1. Paste the older text into Original and the newer text into Changed.
  2. The differences appear a moment later. Added lines are marked +, removed lines −, and a line that was edited is shown as the old line over the new one with the changed words crossed out or underlined.
  3. Use Swap to compare in the other direction, Copy diff to copy the differences as a standard unified diff, and Reset to start again.

Comparing two JSON documents? Format both with the JSON Formatter & Validator first, so differences in spacing do not hide the real changes.

What Counts as a Difference

The comparison works line by line. A line is added or removed when it exists on only one side. When a removed line and an added line right next to it are similar, they are shown together as changed and compared word by word. Lines far apart are never matched with each other.

Spaces and tabs count by default, so indentation changes in code or configuration show up. Tick Ignore whitespace-only changes to treat runs of spaces and tabs, and spaces at the start or end of a line, as the same. It never joins words: hello world and helloworld are still different. Windows and Unix line endings are treated as the same, and so is a missing newline at the very end. Upper and lower case are always different.

Limits and Privacy

Up to 300,000 characters and 20,000 lines per side. Anything larger is refused with a message rather than cut short. Very large comparisons wait for the Compare button so the page stays responsive. If two texts have almost nothing in common, the page says the result is shown as a replaced block rather than a minimal diff.

Both texts stay in your browser. They are not uploaded, not saved and not put in the page address. Reloading the page clears them.

Frequently Asked Questions

Is my text sent anywhere?

No. The comparison runs in your browser and the text is not uploaded or stored by ToolZen Hub.

Why is a line shown as removed and added instead of changed?

A line is only shown as changed when it is next to its replacement and the two share enough words. Otherwise showing it as removed and added is the more honest description.

Why do two texts that look the same show differences?

Usually trailing spaces, tabs instead of spaces, or look-alike characters such as a non-breaking space or a curly quote. Ticking Ignore whitespace-only changes hides the first two.

What does Copy diff copy?

A standard unified diff: --- and +++ headings, @@ hunk headers, three unchanged lines of context, - for removed lines and + for added ones. Other diff and patch tools can read it.