Text Diff Checker

Paste two versions of a text and see what changed line by line, with additions in green and removals in red. The comparison runs in your browser.

Updated

Text ToolsTrending● Free No upload Instant

Loading Text Diff Checker…

Your browser is preparing the tool. It runs 100% locally.

Quick answer

Paste an original and a changed text and the tool compares them line by line. Unchanged lines stay plain, removed lines turn red and added lines turn green. It compares by position, line one against line one and line two against line two. That keeps the output easy to read, but inserting a line near the top can make everything below it show as changed. Your browser does the comparison, so neither text leaves your device.

What the Text Diff Checker does

This tool shows the differences between two versions of a text. It lines them up and marks each line as unchanged, removed or added, so you can see what was edited between the original and the new version.

Use it to spot edits between two drafts, two config files or two code snippets: what was taken out, what was put in, and what stayed the same.

How it works

The tool splits both texts into lines and compares them position by position: the first line of the original against the first line of the changed text, the second against the second, and so on. If two lines match, the line is shown unchanged. If they differ, the original line is marked as removed and the changed line as added.

Git and most diff tools work differently. They use the Myers algorithm, which finds the longest common subsequence, so inserting or deleting a line counts as a single change. Here an insertion near the top shifts every line below it out of alignment, and they all show as changed.

What it checks & how

  1. Split into lines. Break both the original and the changed text into lines.
  2. Compare by position. Line up the two and compare line one to line one, line two to line two, and so on.
  3. Mark each line. Show matching lines plainly. A differing line appears twice: the original marked as removed, the new one as added.
  4. Show the result. Display the marked-up comparison, removals in red and additions in green.

How it compares

for each line position i: original[i] == changed[i] → unchanged original[i] != changed[i] → - original[i] (removed) and + changed[i] (added)
Worked example
apple / banana / cherry vs apple / BANANA / cherry → line 2: - banana + BANANA (lines 1 and 3 unchanged)

Because it compares by position, inserting a line near the top pushes the following lines out of alignment, so they all show as changed. A Myers or longest-common-subsequence diff would recognise the single insertion.

Standards and references

  • Positional line comparison: The two texts are compared line by line at the same positions. The output is predictable and works well when edits happen in place, without lines being added or removed.
  • Not a Myers / LCS diff: git, GNU diff and most diff tools use the Myers algorithm (Eugene Myers, 1986), based on the longest common subsequence, which treats an inserted or deleted line as one change. This tool does not, so inserts and deletes shift the alignment.
  • Line granularity: Differences are shown for whole lines. A changed line appears as a removed line plus an added line, and the tool does not highlight the changed words or characters inside it.

Accuracy and limits

When lines are edited in place and none are added or removed, the comparison is accurate: the changed lines are flagged and the rest show as unchanged.

Insertions and deletions can mislead it. Adding or removing a line near the top shifts everything below out of alignment, so many unchanged lines are reported as changed. A Myers or longest-common-subsequence diff would handle this correctly.

It works on whole lines. A line with a one-word edit shows as a removed line plus an added line, and the specific word that changed is not highlighted.

Matching is exact and case-sensitive. A difference in capitalisation, spacing or punctuation makes two lines count as different, so even trivial formatting changes show up as edits.

Real-world uses

Comparing two drafts

Check what an editor changed between your draft and theirs.

Checking config edits

Find the settings that differ between two copies of a config file.

Reviewing a snippet

Compare two versions of a short piece of code before you paste it back.

Proofreading changes

Confirm which lines were altered and which were left alone.

When it fits, and when it doesn't

Good for

  • Comparing two texts line by line
  • Spotting lines edited in place
  • A quick, readable view of changes
  • Checking config or draft changes

Not the best choice for

  • Texts with inserted or deleted lines
  • Word-level or character-level diffs
  • Large files needing an exact diff
  • Merging or three-way comparison

For inserted or deleted lines, or for word-level changes, use git diff or a dedicated diff app. They use the Myers (longest common subsequence) algorithm and align the texts correctly, which this positional comparison cannot do.

Frequently asked questions

How does it compare the two texts?
Line by line, by position: the first line of the original against the first line of the changed text, the second against the second, and so on. Matching lines are shown plainly, and differing lines are marked as removed and added.
Why does it show every line as changed after I add a line?
It compares by position. Inserting a line near the top moves every line below it down by one, so none of them matches the line at its old position any more. A Myers or longest-common-subsequence diff would recognise the single insertion.
Is this the same diff git uses?
No. git and most diff tools use the Myers algorithm (1986), based on the longest common subsequence, which treats an inserted or deleted line as one change. This tool uses a simpler positional line comparison.
Does it highlight the exact word that changed?
No. It compares whole lines, so a changed line appears as a removed line plus an added line, with no highlighting of words or characters inside it.
When is the comparison most accurate?
When lines are edited in place and none are added or removed. In that case the changed lines are flagged correctly and the rest show as unchanged.
Is it case-sensitive?
Yes. A difference in capitalisation, spacing or punctuation makes two lines count as different, so even small formatting changes show up.
What do the colours mean?
Lines removed from the original are red with a minus sign. Lines added in the changed text are green with a plus sign. Matching lines are plain.
Can it compare more than two texts?
No, it compares exactly two: an original and a changed version. A three-way comparison or a merge needs a dedicated diff or merge tool.
Does it work for code as well as prose?
Yes, as long as the lines were edited in place. Code edits often add or remove lines, though, and then the positional comparison falls out of alignment. A Myers-based diff such as git diff handles that better.
Why are two visually identical lines marked as different?
There is usually a hidden difference: a trailing space, a tab where the other line has spaces, or different punctuation. Matching is exact, so any character difference counts.
Is my text uploaded?
No. Your browser compares the two texts itself and sends nothing to a server, so both versions stay on your device.
How can I get a more accurate diff?
Use a tool built on the Myers or longest-common-subsequence algorithm, such as git diff or a dedicated diff application. They align the texts so an insert or delete counts as one change.

References

This is a simple positional diff: line 1 is checked against line 1, line 2 against line 2. Git and most diff tools use the Myers (longest common subsequence) algorithm instead, which handles inserted lines better.

PopularHot

Word Counter

Count words, characters, sentences and paragraphs as you type, with reading and speaking time alongside.

TextOpen Tool

Reverse Text

Reverse text by character, by word or by line.

TextOpen Tool

Find and Replace Text

Find and replace every match in your text at once, with optional case-insensitive and regex modes. Plain searches match literally.

TextOpen Tool
Popular

Case Converter

Switch text between UPPERCASE, lowercase, Title Case, Sentence case, and aLtErNaTiNg with one click per case.

TextOpen Tool
Trending

Lorem Ipsum Generator

Generate placeholder Lorem Ipsum paragraphs, starting with the classic opening line or fully random.

TextOpen Tool

Remove Duplicate Lines

Remove duplicate lines from a list while keeping the first copy of each in its original position.

TextOpen Tool

Back to the Text Diff Checker

Run your check at the top of the page. What you enter stays on this device.