Back to Tools

Text Diff Checker

Compare two texts and see differences highlighted line by line.

Enter text in both fields above to see the differences.

About This Tool

Compare two versions of a text line by line and see added, removed and unchanged lines highlighted in side-by-side or unified view.

See exactly what changed between two versions

Reading two drafts back and forth to find an edit is tedious, and a single changed word in a long contract or config file is easy to miss. A diff checker does the comparison for you. Paste the original text on one side and the modified text on the other, and every line that was added, removed or left alone is marked. Writers use it to review edits, developers use it to compare configuration files or code snippets without a version control system, and students use it to check revisions. The comparison runs locally in your browser.

How to compare texts

  1. Paste the earlier version into Original and the newer version into Modified. The comparison updates as you type.
  2. Choose Side by Side to see the two versions in parallel columns, or Unified to see one combined list with both old and new line numbers.
  3. Check the counters for Added, Removed and Unchanged lines.
  4. Press Swap to reverse which side counts as the original, Copy Diff to copy the result as text, or Clear to empty both boxes.

Reading the output

Lines that exist only in the original are shown in red with a minus sign. Lines that exist only in the modified text are green with a plus sign. Lines with no marker are identical in both. When a line was edited rather than simply inserted or deleted, it appears as a removal of the old line followed by an addition of the new one; in side-by-side view these are placed on the same row so the before and after sit next to each other.

The copied diff uses a familiar plain-text format: each line starts with + , - or two spaces. That makes it easy to paste into an email, a ticket or a chat message.

How the comparison works

The tool splits both texts into lines and finds the longest common subsequence (LCS): the largest set of lines that appear in both versions in the same order, though not necessarily next to each other. Those lines are reported as unchanged. Everything in the original that is not part of that sequence was removed, and everything in the modified text that is not part of it was added.

This is the same idea behind classic tools such as the Unix diff command and the change views in version control systems. Using the longest common subsequence means the result describes the changes with as few additions and removals as possible, rather than flagging everything after the first difference.

Line matching is exact. Two lines are considered the same only if every character matches, including capitalization, spaces and tabs.

Tips for a cleaner comparison

  • Trailing spaces and tabs count. If lines look identical but show as changed, invisible whitespace is usually the reason.
  • Reflowed paragraphs look like big changes. If one version wraps lines at different points, the diff will mark whole paragraphs. Put each sentence or paragraph on its own line in both versions before comparing.
  • Format structured data first. Two JSON files with different indentation will differ on almost every line. Run both through the JSON formatter so only real differences remain.
  • Very long texts take more memory and time, because every line of one text is compared with every line of the other. Split huge documents into sections if the page slows down.

FAQ

Does it highlight the changed words within a line?

No. Comparison is line by line, so an edited line is shown in full as removed and re-added. Breaking long lines into shorter ones makes changes easier to pinpoint.

Can I ignore case or whitespace differences?

There is no ignore option. To compare without case differences, convert both texts to lowercase first with the text case converter.

Is my text stored anywhere?

The comparison is done in the page itself, and the text is not saved once you leave or clear it.