ToolsHub4u

Compare two versions of a text line by line

Paste two versions of a document and see exactly which lines were added, removed or left alone, with a similarity score and rules for what counts as a difference.

  • Line-by-line diff
  • Line numbers
  • Ignore case or spacing
Ready Text & Writing
Line-based, like a code diffA reworded sentence counts as one removed line and one added line, even if most of the words are the same.
1Enter
2Adjust
3Copy result

Text Comparison

1

The two versions

Line breaks define what is compared.

Comparison rules
No text yet Live
2

Differences

Added + removed

3

2 added, 1 removed

Version AVersion BLine
11Opening hours
2Monday to Friday: 9:00 to 17:00
2Monday to Friday: 9:00 to 18:00
33Saturday: 10:00 to 16:00
44Sunday: closed
55Contact: hello@example.com
6Parking: rear entrance
Added
2
Removed
1
Unchanged
4
A lines
5
B lines
6
Similarity
67%

Removed lines come from version A; added lines come from version B. Line numbers refer to the original versions.

Paste two versions of a document and the tool marks what changed: lines added, lines removed and lines that stayed the same. It compares line by line rather than word by word, which suits drafts, code, contracts and lists far better than prose edits inside a sentence.

The page loads with a worked example already in the boxes. Compare the two and you get one added line and one removed line, two unchanged, and a similarity of 67%.

How the comparison works

The tool splits each version into lines, then finds the longest common subsequence — the largest set of lines that appears in both versions in the same order. Everything outside that set is reported as added or removed.

Worked exampleVersion A: one / two / three
Version B: one / 2 / three
Result: 1 added, 1 removed, 2 unchanged
Similarity: 67%

The second line is not reported as "changed". It is reported once as removed (the old line) and once as added (the new line), because a line-based diff has no way to know the two are related. On a document where every paragraph was reworded, that means twice as many marked lines as paragraphs you actually edited.

Similarity is unchanged lines divided by the longer of the two line counts. In the example, two of three lines are unchanged, so 67%. It is not a percentage of words or characters, and it does not measure how much of the meaning survived.

The three rules

What each ignore rule does, with an example of lines that only match when it is on
RuleWhat it ignoresLines that match only with it on
Ignore caseCapital and lowercase differencesHello and hello
Ignore spacesRuns of whitespace, and leading or trailing spaceHello World and hello world
Hide unchangedNothing — it only changes what is displayedThe unchanged lines are hidden from the result

With all three on, Hello World and hello world are reported as a match: similarity 100%, no additions, no removals. That is why the result panel says "The versions match" and the note adds that no differences were found under the current rules.

That note is the most useful line in the output. A 100% result does not mean the files are identical; it means they are identical after the rules you chose were applied. Turn both rules off and compare again before you conclude that nothing changed.

Ignore spaces collapses runs of whitespace to a single space and trims the ends. It does not strip all spaces, so Hello World and HelloWorld are still different lines. Tabs and non-breaking spaces are treated as whitespace too, which is handy when pasting from a PDF or a Word table.

Hiding unchanged lines

On a long document, most lines are unchanged and the diff is buried. Turning on hide unchanged collapses the result to just the added and removed lines, which is what you want when you are reviewing a small edit to a large file.

The statistics still count the unchanged lines, so the similarity figure is the same either way. Only the display changes. When there are no differences at all, the note explains that unchanged lines are hidden and suggests turning the option off to see the full document.

The 800-line limit

Each version is capped at 800 lines. Go past that and the tool returns a warning instead of a diff:

Each version is limited to 800 lines so the browser stays responsive. Split the document and compare it in sections.

There is no result, no similarity figure and no added or removed count in that case — just the warning, which is easy to miss if you are watching the statistics panel rather than the top of the result. If nothing appears, count the lines in your paste before assuming the tool is broken.

An 800-line limit is roughly 12,000 to 16,000 words of ordinary prose, so a long report, a book chapter or a large source file will need splitting. Compare it in sections, keeping a few overlapping lines between sections so you do not miss an edit at a boundary.

What it is good at, and what it is not

Line-by-line comparison is the right model for anything where a line is a unit:

  • Code and configuration. One changed line is one changed line, and indentation differences are real differences.
  • Lists and inventories. Added and removed rows are obvious, and the similarity figure tells you how much of the list survived.
  • Contracts and policies. A reworded clause shows as a removed line and an added line, which is exactly what a reviewer needs to see.
  • Transcripts. Two versions of the same recording, compared by speaker turn.

It is the wrong model for comparing two paragraphs of prose that were edited in place, because every changed line becomes two marks and the output reads as noise. It will not highlight the words inside a line, will not merge near-identical lines, and will not tell you whether the change was an improvement. For a word-level or similarity-based comparison, use the similarity checker instead.

One more thing it does not do: reorder detection. If a paragraph moved from section 2 to section 5, the diff sees a removal in one place and an addition in another. That is technically accurate and practically confusing.

Practical notes

  • Line endings do not matter. Windows and Unix line breaks are both split correctly, so a file saved on one system compares cleanly against the other.
  • Trailing whitespace is a real difference unless ignore spaces is on. Editors that strip trailing spaces on save will produce diffs full of lines that look identical.
  • Both boxes are required. If either is empty, the tool asks for both passages rather than reporting everything as added.
  • Nothing is uploaded. The comparison runs in the tab and a reload clears both boxes.

Check the similarity figure first, then read the added and removed lines in order. The figure tells you how big the change is; the line list tells you what it is.

Questions

Common questions

Short answers to what people ask before using this tool.

How do I compare two texts?

Paste the original in the first box and the revised version in the second. The result lists added lines, removed lines and unchanged lines, with a similarity percentage. Both boxes are required.

Is the comparison line by line or word by word?

Line by line. A changed line is reported as one removal and one addition, and words inside a line are not highlighted. For a word-level comparison, use the similarity checker.

What does the similarity percentage mean?

Unchanged lines divided by the longer of the two line counts. Three lines with two unchanged gives 67%. It measures line overlap, not meaning or word-level similarity.

Why does it say the versions match when they look different?

Because ignore case or ignore spaces is on. "Hello World" and "hello world" match under both. Turn the rules off and compare again to see the real differences.

Why is there no result at all?

One of the versions is over 800 lines. In that case the tool returns a warning and no diff, so check the length of your paste. Split the document and compare it in sections.

Can I compare two Word documents?

Only as text. Copy the contents of each document into the boxes. Formatting, tables and tracked changes are not read, and a table pasted from Word may arrive as one long line.

Does it show where a paragraph moved?

No. A moved paragraph appears as a removal in its old place and an addition in its new one. That is accurate for a line-based diff but reads as two separate edits.

Is my text uploaded?

No. Both versions are compared in the browser tab and nothing is stored. Reloading the page clears both boxes.