Skip to content

Text Diff and Compare Tool

Compare two blocks of text side by side and highlight the differences. Find additions, deletions, and changes instantly.

Text Diff and Compare Tool tool

Loading...

Example

Input: Original: apple / banana / cherry. Modified: apple / blueberry / cherry (one item per line)

Result: +1 added, -1 removed, 2 unchanged; the diff shows -banana followed by +blueberry

The texts are compared line by line. Lines present in both stay unchanged, while the replaced line is shown as one removal and one addition.

  1. Paste or type the original text into the left box.
  2. Paste or type the changed text into the right box.
  3. Read the diff below: green lines marked + were added and red lines marked - were removed.
  4. Check the summary bar for the number of added, removed and unchanged lines.
  5. For a changed line, compare the red old version with the green new version under it.

How to Compare Two Texts Line by Line

This text diff tool compares two versions of a text and shows every line that was added or removed. Paste the original on the left and the new version on the right. The result appears below as one color-coded list: green lines marked + were added, and red lines marked - were removed.

The comparison works line by line, like the diff command or a Git pull request. If one word in a line changes, the whole line shows twice: first the old version in red, then the new one in green. Read the pair together to find the edit. A summary bar counts the lines added, removed and left unchanged, which tells you at a glance how big a revision is.

Spaces count. A line with a trailing space, or a tab where the other has spaces, is a different line to the tool. It will show as changed even if it looks the same. If only the words matter to you, clean both texts first with the Whitespace Remover. A missing line break at the very end of a text is ignored, so it will not flag your last line. People use it to check edits to a contract or essay, compare two config files, or see what changed between two exports of a list. For JSON data, the JSON Diff Viewer is a better fit, because it ignores key order and formatting. Both texts stay in your browser.

Frequently Asked Questions

No. The comparison works on whole lines. If one character in a line changes, the old line is shown in red and the new line in green right below it. Put your texts one sentence per line before comparing if you want each change to stand out more clearly in long paragraphs.
Something invisible is different. Common causes are a space at the end of the line, a tab instead of spaces, a non-breaking space, or curly quotes in one text and straight quotes in the other. Run both texts through a whitespace cleaner, or retype the quotes, and compare again.
Copy the text out of each file and paste it into the two boxes. Only the text is compared, so changes to bold, fonts or layout will not show. For a .docx file you can pull out the text with a Word to Text Extractor first.
Yes. It works with any plain text, including source code, config files, CSV exports, JSON and XML. Indentation and spaces are kept and compared exactly, and the result is shown in a monospaced font, so it reads much like a Git diff. It does not understand the code, so moving a function counts as removing and adding lines.

Related Tools

Find and Replace

Find and replace text with regular expressions, capture groups, case-sensitive matching, and a live match count.

Text and Writing

Word Counter and Character Counter

Count words, characters, sentences, and paragraphs in your text. Includes reading time and speaking time estimates.

Text and Writing

Remove Duplicate Lines

Remove duplicate lines from text while keeping the original order. Supports case-sensitive and case-insensitive modes.

Text and Writing

Sort Lines

Sort lines of text alphabetically (A-Z or Z-A) with natural number order, by line length, or shuffle and reverse them.

Text and Writing

Whitespace Remover and Trimmer

Remove extra whitespace, trim leading and trailing spaces, collapse multiple spaces, and clean up messy text formatting.

Text and Writing