Developer Tools

Diff Checker

Compare two texts or code files line by line, inline or side by side, with changed words highlighted.

By Nitin Raturi · Last reviewed

Input

How to use the Diff Checker

See exactly what changed between two versions of a text.

  1. Paste the original text.
  2. Paste the changed text.
  3. Choose inline or side-by-side view, and whether to ignore spacing or capitals.
  4. Read the marked lines: − removed, + added, with changed words highlighted.
  5. Copy or download the unified diff to share it.

Good to know

  • Tap the ⓘ next to any field for a short guide to it.

Line-by-line comparison using the Myers shortest-edit algorithm, with changed words highlighted.

Runs in your browser. Nothing you type is uploaded or saved in the link.

Original text

The earlier version: the text you are comparing from.

How to fill it in

  • Paste any text, code or list. Lines are compared one by one.

Example

In the sample, 2 lines were removed and 3 added; 3 stayed the same.

Changed text

The later version: the text you are comparing to.

How to fill it in

  • Paste the new version. Both texts stay in your browser.

View

Inline shows one list with removed and added lines. Side by side shows the two versions in columns.

How to fill it in

  • Inline is easiest on phones. Side by side suits wide screens and long code.

Ignore spacing

Treats lines as equal when they differ only in spaces or tabs.

How to fill it in

  • Turn on to skip indentation and trailing-space changes.

Ignore capitals

Treats lines as equal when they differ only in capital and small letters.

How to fill it in

  • Turn on to compare wording only.

Result

2 removed, 3 added

Unchanged lines
3
Removed lines
2
Added lines
3
Changes, line by line
OldNewChangeText
11 Invoice 1024
22 Customer: Asha Rao
3−Amount: ₹12,500
4−Due: 30 days
3+Amount: ₹13,750
4+Due: 15 days
5+Paid by UPI
56 Thank you

Unified diff

--- original
+++ changed
@@ -1,5 +1,6 @@
 Invoice 1024
 Customer: Asha Rao
-Amount: ₹12,500
-Due: 30 days
+Amount: ₹13,750
+Due: 15 days
+Paid by UPI
 Thank you

How this calculator works

  1. Step 1Split into linesLine by lineEach line is compared as a whole.
  2. Step 2Find the longest matchMyers algorithmThe fewest removals and additions that turn one text into the other.
  3. Step 3Highlight the wordsInside changed linesOnly the words that differ are marked.

A diff lists the smallest set of removed and added lines that turns the original into the changed text. Lines that match stay as context.

Worked example: an edited invoice

The two invoice texts differ in 2 removed and 3 added lines; 3 lines match.

Comparing the sample invoices
Smallest edit
removed + added = lines in both − 2 × longest common subsequence
  1. Original lines5
  2. Changed lines6
  3. Lines in common, in order3
  4. Removed (line 3)Amount: ₹12,500
  5. Removed (line 4)Due: 30 days
  6. Added (line 3)Amount: ₹13,750
  7. Added (line 4)Due: 15 days
  8. Added (line 5)Paid by UPI
  9. Total edits5

Reading the result

  • InlineOne listRemoved lines marked −, added lines marked +. Best on phones.
  • Side by sideTwo columnsOriginal on the left, change on the right. Best for code on wide screens.
  • Ignore spacingSkip changes in indentation and spaces.
  • Ignore capitalsCompare wording only.
  • Unified diffThe standard patch format, ready to copy or download.
  • Nothing uploadedBoth texts stay on your device.

A diff shows what changed. Formatting first makes the real changes easier to see.

To format JSON before comparing, use the JSON formatter. The remove duplicate lines tool tidies lists, and the word counter measures each version.

Common mistakes

  • Mistake: Comparing files saved with different line endings.

    Instead: The checker treats Windows and Unix line endings the same.

  • Mistake: Reading a moved paragraph as new text.

    Instead: A move shows as removed in one place and added in another.

  • Mistake: Pasting confidential documents into online tools.

    Instead: This tool runs locally, but remove secrets anyway when sharing a diff.

Read how we test our calculators, or browse more developer tools.

Frequently asked questions

Is my text uploaded?

No. The comparison runs in your browser. Neither text is sent anywhere or saved in the link.

How does the checker decide what changed?

It uses the Myers algorithm, which finds the smallest number of removed and added lines that turns one text into the other.

Why does a moved paragraph show as removed and added?

A line diff works in order. When a block moves, the shortest edit is to remove it in one place and add it in another.

What is a unified diff?

The standard patch format used by Git and the diff command: lines starting with − were removed, lines with + were added, and the rest is context.

Can it ignore indentation changes?

Yes. Turn on “Ignore spacing” to treat lines as equal when they differ only in spaces or tabs.

Sources and methodology

The formulas are standard time-value-of-money results. We check every figure against golden values worked out independently, by closed form and by month-by-month simulation; see the methodology.

Written and maintained by Nitin Raturi, a software engineer (about the author). Last reviewed 27 Oct 2026; next review due by . Found an error? Tell us.

Changelog

  • : Initial release. Demand metrics remain unverified.