Toolvist

Diff Checker / Text Compare

Compare two blocks of text and highlight every added, removed and changed line. Free online diff checker for code, configs and documents.

0
Added
0
Removed
0
Unchanged
Differences

Differences will appear here as you type.

Free Diff Checker / Text Compare Tool

Compare two blocks of text and instantly see what changed. This diff checker highlights added, removed, and unchanged lines side by side, so you can spot edits in code, configs, or documents at a glance.

Comparing text is usually followed by Find & Replace Text if the difference should be corrected, and by Remove Extra Spaces & Line Breaks if invisible whitespace is the cause. For a structural comparison rather than a textual one, the JSON Validator checks the shape.

How to use the Diff Checker

  1. 1 Paste the original text in the left pane and the changed text in the right.
  2. 2 Press Compare. Removed lines are marked in one style and added lines in another.
  3. 3 Switch between line and word comparison if the changes are small within long lines.
  4. 4 Ignore whitespace if the two versions were formatted differently.

Reading a diff well

A diff is a description of change, and its usefulness depends on the two versions being comparable. Comparing a file against a reformatted version of itself produces a diff full of nothing, which is why normalising whitespace first is often the right move.

The most useful habit is to compare in the direction that matches how the change was made. Comparing an old file against a new one shows what was added; comparing in the other direction shows what was removed. Both are the same information, but one usually reads more naturally for a given change.

  • A line diff is coarse; a word diff is precise but noisier.
  • Ignore whitespace when the versions were formatted differently.
  • Ignore line endings when a file was moved between platforms.
  • Format structured data before comparing it.

How the comparison works

The tool splits both inputs into lines and runs a longest-common-subsequence comparison to find matching, inserted, and deleted lines. This is the same family of algorithm used by Git to display diffs, so the output is consistent with what you would see in a version-control system.

Frequently asked questions

What is the difference between a line diff and a word diff?

A line diff compares whole lines and reports any line that differs as entirely changed. A word diff compares within lines, so it can show that one word was inserted into an otherwise identical paragraph. For code, line diffs are the convention because a change usually affects whole statements. For prose, word diffs are far more useful.

Why does my diff show every line as changed?

Usually because of line endings or trailing whitespace. A file converted from Windows to Unix line endings has no content differences at all but differs on every line. Similarly, a file that gained a trailing space on each line, or an extra blank line at the start, produces a diff of the whole file. The ignore options exist for exactly this.

How do I compare versions that are not plain text?

By extracting the text first. Configuration in JSON or YAML can be pasted directly. Documents need their text extracted, and binary files cannot be compared this way at all. For structured data, formatting both sides before comparing removes formatting noise and leaves the real change.

Related Developer Tools

Browse all Developer Tools →

You might also need

Tools from other categories that people pair with the Diff Checker:

Browse the full tool directory →