Tools/Text Tools/Text Compare

Text Compare – Line-by-Line Diff Checker

Compare two texts line by line and see exactly which lines were added, deleted or left unchanged, with line numbers and a downloadable diff.

If this tool isn’t working as expected, please take a screenshot of the error and report the problem here so we can investigate and improve it.

About this tool

When two versions of a document, list, config file or piece of code need to be checked against each other, reading both by eye is slow and error-prone. This tool compares them the way diff tools do: it finds the longest run of lines the two texts share, in order, and reports everything else as added or deleted.

Because order matters, a reordered line or a line that was added twice is not hidden, which a simple 'which lines appear in both' check would miss. Counts and line numbers tell you at a glance how big the change is and where it is.

This text comparison tool shows exactly what changed between two versions of a text. Paste the original into Text A and the changed version into Text B, and it lines them up and marks every added line with + and every deleted line with −, with line numbers from both texts, counts for added, deleted and unchanged lines, and a unified diff you can copy or download. Lines are compared in order, so moved lines and repeated lines show up as changes. Everything runs in your browser.

How to Use Text Compare

Paste Both Texts

Add the first text in one box and the second text in the other box.

Compare Lines

The tool lines the two texts up in order and finds what was added and deleted. Optionally ignore whitespace, case or blank lines.

Review Differences

Read the + (only in Text B) and − (only in Text A) lines, with line numbers and a summary count.

Copy or Download

Copy the result or download it as a unified diff file.

Common Workflows

Paste Both Versions

Put the original in Text A and the changed version in Text B. The comparison updates as you type.

Read the Summary

Check the added, deleted and unchanged counts. 'The texts are identical' appears when nothing differs.

Scan the Changes

Lines marked + exist only in Text B and lines marked − exist only in Text A. Long unchanged parts are folded away, and you can show everything instead.

Ignore the Noise

Turn on Ignore whitespace, Ignore case or Ignore blank lines when spacing or capitalization changes don't matter.

Copy or Download the Diff

Copy diff or Download diff gives a standard unified diff with context lines, built from exactly what is on screen.

Best For

  • A true line-by-line diff: added (+), deleted (−) and unchanged lines in order, with line numbers from Text A and Text B. An edited line appears as a deleted line followed by an added line.
  • Options to ignore whitespace, ignore capitalization and ignore blank lines. They only affect the comparison - your text is never changed, and the lines are shown as you typed them.
  • Swap A and B, clear both boxes, copy the result or download it as a standard unified diff (.diff) built from the same comparison. Long unchanged stretches are folded so you can focus on the changes.

Examples

A changed price line

Input

Text A: "Introduction / The price is $10. / Conclusion / Thanks". Text B: "Introduction / The price is $12. / Conclusion / Thanks".

Output

− The price is $10.   + The price is $12.   (3 lines unchanged, 1 added, 1 deleted)

The edited line appears as a deletion followed by an addition at the same place, with the line numbers of both texts, and the surrounding lines are marked unchanged.

Use Cases

Checking whether two documents are identical

If the summary says the texts are identical, every line matches in order.

Finding what changed between two versions of a file

Paste both versions and read the + and − lines to see exactly what was added and deleted.

Sharing a change as a diff

Download or copy the unified diff to attach to a ticket, email or code review.

Common Mistakes

Problem

Expecting a moved line to count as unchanged

Solution

Order matters. A line moved elsewhere is shown as deleted in one place and added in the other.

Problem

Expecting highlighting inside a changed line

Solution

Changes are shown per line. A line that differs by one word appears as a whole line deleted and a whole line added; there is no word-level highlighting.

Problem

Forgetting that spacing and case count by default

Solution

'Total' and 'total', or a line with an extra space, are different lines until you turn on Ignore case or Ignore whitespace.

Problem

Pasting a very large file

Solution

The comparison works on up to 8,000 lines or 1,000,000 characters per side. Beyond that you are asked to compare a smaller part.

Tips & Best Practices

Use the options for formatting-only changes

Ignore whitespace and Ignore blank lines make re-indented or re-spaced text compare as identical.

Swap A and B to see the reverse change

Swap A and B turns additions into deletions and the other way round.

Read the unified diff in other tools

The downloaded .diff uses the standard format (--- / +++ / @@ hunks), which review tools and editors understand.

Line endings don't matter

Windows (CRLF), Unix (LF) and old Mac (CR) line endings compare as equal, and one final newline is not counted as a difference.

Limitations

Line-level only

The tool compares whole lines. There is no highlighting of the changed words or characters inside a line, no syntax highlighting and no three-way merge.

Size limits

Up to 8,000 lines or 1,000,000 characters per text. Two texts that share many of the same lines in a completely different order (for example the same lines reversed) can also be refused for line-by-line comparison, with a message, to keep your browser responsive.

Diff only

The tool shows and exports a diff. It cannot apply a patch, compare folders or files directly, or keep a history of versions.

With ignore options on, equal lines show Text A's wording

When two lines differ only in spacing or capitalization and you chose to ignore that, they count as unchanged and Text A's version is displayed.

Comparisons

This Line Diff vs. a Code-Editor Diff

Both compare line by line in order; they differ in how much detail they show.

This toolA code-editor or IDE diff
ComparisonOrdered line-by-line diff with line numbers and countsOrdered diff, usually with word-level and syntax highlighting
OutputCopy or download a standard unified diffOften a side-by-side view and patch tools
Where it runsIn your browser, nothing uploadedIn your editor or a hosted service

Which should you use?

Use this tool for a quick, private check of what changed between two texts. Use an editor's diff when you need word-level highlighting or to merge changes.

FAQs

The most common questions are whether this is a real diff and whether it shows modified lines. It is a real line-by-line diff in order; a changed line is shown as the old line deleted and the new line added. The FAQ below covers the options, the size limits and what the diff file contains.

Is this a real diff, or does it just list matching lines?

It is a real line-by-line diff. The two texts are lined up in order, lines marked + exist only in Text B, lines marked − exist only in Text A, and unchanged lines are shown in between, with line numbers from both texts.

How are edited lines shown?

As a deleted line followed by an added line at the same place. There is no word-level highlighting inside the line.

Does order matter? What about repeated lines?

Yes. Lines are compared in order, so a line moved to a different place is shown as deleted and added, and a line repeated three times in one text and once in the other shows two deletions.

What do Ignore whitespace, Ignore case and Ignore blank lines do?

They change how lines are compared, never the text itself. Ignore whitespace treats lines that differ only by spaces or tabs at the ends or repeated inside as equal; Ignore case treats Total and total as equal; Ignore blank lines skips empty lines. Equal lines are shown as they appear in Text A.

Can I download the result?

Yes. Copy diff and Download diff give a standard unified diff (--- / +++ headers and @@ hunks with three lines of context), built from the same comparison you see on screen.

How big can the texts be?

Up to 8,000 lines or 1,000,000 characters per text. Larger input is not compared, and you are told why, so the page never freezes. Texts that share many lines in a completely different order (such as the same lines reversed) can also be refused.

Does Windows versus Linux line endings matter?

No. CRLF, LF and CR line endings compare as equal, and a single newline at the end of a text is not counted as an extra line.

Is my text uploaded anywhere?

No. CoditTools compares your text entirely in your browser using JavaScript. Nothing is sent to a server.

Get more tools like this

Leave your email so we can prioritize similar tools and updates.