UnitConv
Text & Dev

Text Diff Checker

Compare two blocks of text and instantly see added, removed and unchanged lines side by side

Original

Changed

+0
Added lines
-0
Removed lines
0
Unchanged lines

All comparison happens locally in your browser. Your text is never sent to a server.

Differences

Paste text into both boxes to see the differences.

About this tool

This text diff checker compares two blocks of text and shows you exactly what changed between them. Paste the original on the left and the changed version on the right, and the tool lines them up to reveal added, removed and unchanged lines at a glance. Added lines are highlighted in green, removed lines in red, and untouched lines stay neutral. You can switch between a unified view, which stacks everything in a single column with + and - markers, and a side-by-side view, which places the two versions in aligned columns. Optional toggles let you ignore whitespace, ignore letter case and ignore trailing spaces so cosmetic differences do not clutter the result. A running tally shows how many lines were added, removed and left unchanged. Everything is computed locally in your browser, so even large or sensitive documents never leave your device.

How to use

  1. 1 Paste or type the original text into the left box and the changed text into the right box.
  2. 2 Pick a view: side by side to compare columns, or unified for a single-column +/- list.
  3. 3 Turn on ignore whitespace, ignore case or ignore trailing spaces to skip cosmetic differences.
  4. 4 Read the highlighted lines and the added/removed/unchanged counts, then copy the result if you need it.

How it works

The tool splits both texts into lines and compares them with the Longest Common Subsequence (LCS) algorithm. LCS finds the largest set of lines that appear, in the same order, in both versions - these are the unchanged lines. Everything not in that common subsequence is then classified: a line only in the original counts as removed, and a line only in the changed text counts as added. Because the LCS is genuinely maximal, the diff uses the smallest possible number of additions and deletions, which is what makes the result feel natural rather than re-flagging whole paragraphs. The ignore options apply only during comparison: lines are normalized (trimmed, collapsed whitespace, lower-cased) to decide whether they match, but the original text is always what gets displayed. No external libraries are used and nothing is uploaded.

Frequently asked questions

Is my text sent to a server?

No. The entire comparison runs in your browser using JavaScript. Your original and changed text never leave your device, so it is safe to diff private code, contracts or notes. You can even disconnect from the internet and the tool keeps working.

What is the difference between unified and side-by-side views?

Unified view stacks everything in one column, marking added lines with + and removed lines with -, similar to a git or patch output. Side-by-side view puts the original and changed versions in two aligned columns so you can scan matching lines horizontally. Both show the same diff - choose whichever is easier to read for your text.

What do the ignore options do?

Ignore whitespace trims each line and collapses runs of spaces and tabs so indentation changes do not register. Ignore case treats uppercase and lowercase as the same. Ignore trailing spaces drops spaces and tabs at the end of a line. These options only affect how lines are matched; the displayed text is always your original input.

How is the diff calculated?

It uses a line-based Longest Common Subsequence (LCS) algorithm, the same family of techniques behind tools like diff and git. LCS finds the maximum set of lines common to both versions in order, then marks the rest as added or removed, producing the smallest, clearest set of changes.

Is there a size limit?

Each side is capped at 5,000 lines to keep the comparison fast and the page responsive. If you exceed that, the tool shows a message asking you to shorten the input. For typical documents, code files and articles this limit is more than enough.

Related tools and uses

Pair the text diff checker with the word counter to measure your text, the case converter to normalize capitalization before comparing, and the JSON formatter to tidy data so diffs stay meaningful. People use it to review edits, compare code or config versions, proofread drafts and spot exactly what changed between two revisions.