Compare two versions of a text and see added and removed lines highlighted.
How to use
- Paste the original text on the first box and the changed text in the second.
- Press Compare.
- Green lines were added and red lines were removed.
Good to know
The comparison works line by line, so a small change inside a line shows as one removed line and one added line. Limit is 1500 lines per side.
How Can You Compare Two Pieces of Text and See Exactly What Changed?
A free online text diff checker compares an original text with a changed version and lists every line that was added or removed. Paste both versions into the two boxes, press Compare, and the differences appear with green plus lines and red minus lines. Everything runs in your browser, so nothing you paste is uploaded.
What does the Text Diff Checker do and why is it useful?
Spotting a changed sentence in a long document by eye is slow and unreliable. A diff does the comparison for you. It shows how many lines were added, how many were removed, and the full text with each change marked. That makes it useful for checking an edited contract against the previous draft, comparing two versions of a configuration file, reviewing a colleague's rewrite of an article, or confirming that a copy and paste did not alter anything.
The tool has two textareas: one for the original text and one for the changed text. Nothing is compared until you press the button, so you can paste and edit freely first.
How does the comparison work under the hood?
The tool splits each text into lines and compares them line by line using the longest common subsequence (LCS) method. The longest common subsequence is the longest run of lines that appear in both texts in the same order, even if other lines sit between them. Lines that belong to that shared sequence are unchanged. Lines that exist only in the original are marked as removed, and lines that exist only in the changed text are marked as added.
The output starts with two counts: lines added and lines removed. Below them, every line is shown in order:
- A line starting with
+in green was added. - A line starting with
-in red was removed. - A line with no marker is unchanged.
How is an edited line shown?
The tool compares whole lines, so a line that was edited is not shown as a small tweak. It appears as one removed line (the old version) followed by one added line (the new version). There is no word-level highlighting inside a line.
What counts as a difference?
Lines must match exactly. A capital letter instead of a lowercase one, an extra space at the end of a line, or a different number of spaces all count as changes.
How do you use it step by step?
- Paste the older or reference text into the original text box.
- Paste the newer text into the changed text box.
- Press the Compare button.
- Read the counts of lines added and removed at the top.
- Scan the listing for green
+lines and red-lines, with the unchanged lines giving context between them.
To compare something different, replace the text and press Compare again. The tool does not keep a history of earlier comparisons.
What do real examples look like?
These results were checked with a longest common subsequence calculation on the same inputs.
Example 1: a shopping list
Original:
apple banana cherry
Changed:
apple blueberry cherry date
Result: 2 lines added, 1 line removed.
apple - banana + blueberry cherry + date
The lines apple and cherry form the longest common subsequence. The replaced fruit shows as one removal plus one addition, and date is a pure addition.
Example 2: a capital letter
Original lines: Hello World and line two. Changed lines: hello world and line two.
Result: 1 line added, 1 line removed.
- Hello World + hello world line two
Only the case differs, yet the whole line is flagged, because case differences count as changes.
Example 3: a deleted line
Original: a, b, c, d on four lines. Changed: a, c, d.
Result: 0 lines added, 1 line removed.
a - b c d
Example 4: an invisible trailing space
Original: name: Sam followed by age: 30. Changed: name: Sam (with one space after Sam) followed by age: 30.
Result: 1 line added, 1 line removed.
- name: Sam + name: Sam age: 30
The two lines look identical on screen, but the extra space makes them different. This is a handy way to find stray whitespace. If you want to clean it up, the Remove Extra Spaces tool can trim it.
Example 5: identical texts
Original and changed are both one, two, three on three lines. Result: 0 lines added and 0 lines removed, with all three lines shown as unchanged.
Example 6: a moved line
Original: a, b, c. Changed: c, a, b.
Result: 1 line added, 1 line removed.
+ c a b - c
The longest common subsequence is a, b (two lines). The line c moved from the end to the start, and the tool has no concept of a move, so it reports an addition at the new place and a removal at the old place.
Why does the longest common subsequence matter?
A naive comparison would line up the two texts row by row. As soon as one line is inserted near the top, every later row is offset by one, and the whole rest of the document would be reported as changed. The longest common subsequence avoids that by finding the largest set of lines that still appear in the same order in both versions. Those lines anchor the comparison, and only the lines outside the anchor are marked. This is why inserting a single line in the middle of a long list produces exactly one green line instead of hundreds of mismatches.
What tips give the best results?
- Compare like with like. If one version has Windows line breaks or different wrapping, many lines may look changed even though the content is the same.
- Put one idea per line when you can. Short lines produce more precise diffs than long wrapped paragraphs, because one change inside a long paragraph flags the entire paragraph.
- Normalise capitalisation first when it is irrelevant. The Case Converter can bring both texts to the same case before you compare.
- Use the counts as a quick sanity check. Zero added and zero removed means the lines are identical.
- For lists, sort both versions the same way before comparing, for example with Sort Lines Alphabetically, so order differences do not drown out real edits.
- Compare structured data after formatting it consistently. Running JSON through the JSON Formatter puts each key on its own line, which makes the diff readable.
What are common mistakes?
- Swapping the boxes. The original text belongs in the first box. If the boxes are swapped, additions and removals are reversed.
- Ignoring whitespace. Trailing spaces, tabs and different indentation are changes. If a line looks the same but is flagged, check the whitespace.
- Expecting word-level highlights. The tool shows whole lines only, so look at the removed and added pair to find the exact edit yourself.
- Pasting more than the limit. Each side may hold at most 1500 lines.
- Expecting automatic updates. The result changes only when you press Compare.
Who uses a text diff checker?
- Writers and editors comparing drafts to see what a reviewer changed.
- Developers and system administrators checking configuration files, snippets and logs.
- Students confirming how a revised essay differs from the previous version.
- Legal, HR and operations staff comparing versions of policies or agreements pasted as plain text.
- Anyone who suspects a file or message was altered and wants evidence of where.
Is it private?
Yes. The comparison is carried out by code running in your browser. The text you paste is not uploaded, stored or shared, and no account is needed. The tool keeps no history, so closing or refreshing the page clears everything.
What are the limitations?
- The maximum is 1500 lines for each side.
- The comparison is by whole line only. A changed line is shown as one removed line plus one added line, with no word-level highlighting.
- Case and whitespace differences count as changes, and there is no option to ignore them.
- It compares plain text. It does not open files, so paste the contents instead.
- There is no side by side view, no export and no history.
Frequently asked questions
What does the plus sign mean?
A green line starting with + exists only in the changed text, so it was added.
What does the minus sign mean?
A red line starting with - exists only in the original text, so it was removed.
Why is an edited line shown twice?
Comparison is line by line. An edited line is the old line removed plus the new line added.
Does it ignore uppercase and lowercase?
No. A difference in case makes the lines different.
Does it ignore extra spaces?
No. Differences in whitespace, including a single trailing space, are reported as changes.
How much text can I compare?
Up to 1500 lines in each box.
Is my text sent to a server?
No. The comparison happens in your browser and nothing is uploaded.
Can it compare files directly?
No. There is no file upload. Open the files, copy their text and paste it into the two boxes.
Ready to compare your texts?
Paste both versions and press Compare to see every added and removed line. For more utilities, browse the free tools.
