Diff Checker

Compare two texts side by side with color-coded diff output. LCS-based algorithm, split and unified views, line-by-line or word-by-word diff. Free online diff checker.

Everything runs in your browser — your data is never sent to any server.

Why Use a Diff Checker?

A diff checker helps you quickly identify differences between two versions of text, code, or documents. Whether you're reviewing code changes, comparing configuration files, or checking edits, a visual diff makes it easy to spot additions, deletions, and modifications at a glance.

Key Features

  • LCS (Longest Common Subsequence) diff algorithm for accurate comparison
  • Color-coded output: green for added, red for removed, unchanged in default
  • Split and unified view modes
  • Line-by-line or word-by-word diff toggle
  • Statistics: additions, deletions, and unchanged line counts

How It Works

  1. Paste the original text in the left textarea
  2. Paste the modified text in the right textarea
  3. Choose line-by-line or word-by-word diff mode
  4. Review the color-coded diff output in split or unified view

Technical Details

This diff checker implements the LCS (Longest Common Subsequence) algorithm entirely client-side in JavaScript. It supports both line-level and word-level comparison with O(n*m) time complexity. The split view shows original and modified side by side, while unified view combines both in a single column with + and - prefixes.

Frequently Asked Questions

What algorithm does the diff checker use?

The diff checker uses the Longest Common Subsequence (LCS) algorithm to compute the minimum edit sequence between two texts. This ensures the most accurate and compact diff output.

What's the difference between line-by-line and word-by-word diff?

Line-by-line diff compares entire lines, marking added or removed lines. Word-by-word diff breaks text into tokens and compares at the word level, showing more granular changes within lines.

Is my text sent to a server?

No. All diff computation happens entirely in your browser. Your text never leaves your device.

Related tools