Diff Checker

Compare two texts and see the differences highlighted. Line, word, or character level. 100% client-side.

Last reviewed: April 2026

New to this tool? Click here for instructions

Original
Modified
Diff Output
Paste text in both fields to compare.

Quick Answer

A diff checker compares two blocks of text and highlights exactly what changed โ€” the lines and characters added, removed, or modified between them. Paste an original and a revised version above to see the differences side by side. It is useful for reviewing code changes, contract edits, or any two versions of a document, and everything stays in your browser.

How to Use the Diff Checker

  1. Paste original text into the left (or top) input area.
  2. Paste modified text into the right (or bottom) input area.
  3. Choose a diff mode - Line Diff (default), Word Diff, Character Diff, or Ignore Whitespace.
  4. View the result - added lines appear in green, removed lines in red, unchanged lines in the default color.
  5. Copy the output - click Copy to get the unified diff as plain text.

What This Tool Does

This diff checker compares two blocks of text and produces a color-coded visualization of the differences. It uses a longest common subsequence (LCS) algorithm to determine the minimal set of changes needed to transform the original text into the modified text. The output clearly marks additions, deletions, and unchanged content so you can quickly identify what changed.

Features

  • Line-level diffing - compares text line by line, perfect for code and configuration files
  • Word-level diffing - highlights individual word changes within lines, ideal for documents and prose
  • Character-level diffing - finest granularity, highlights every character difference
  • Ignore whitespace - normalizes spacing before comparing, useful when only content matters
  • Line numbers - both original and modified line numbers displayed alongside the diff
  • Privacy - everything runs in your browser, no data sent anywhere

Diff Algorithms Explained

The core of any diff tool is the algorithm used to determine the longest common subsequence (LCS) between two sequences. The LCS represents the portions of text that are identical in both inputs. Once the LCS is computed, everything not in the LCS is either an addition (in the modified text but not the original) or a deletion (in the original but not the modified).

When to Use Each Diff Mode

Line Diff is best for comparing source code, log files, or any structured text where changes typically affect entire lines. Word Diff works well for natural language text, documentation, and content where individual word changes matter. Character Diff is useful for spotting typos, single-character changes, or comparing very similar strings. Ignore Whitespace is invaluable when comparing code that has been reformatted with different indentation styles.

Common Use Cases

Developers use diff checkers for code review (comparing old and new versions of code), configuration auditing (detecting changes in config files), content editing (tracking changes in articles or documentation), debugging (comparing expected vs. actual output), and merge conflict resolution (understanding conflicting changes). This tool gives you instant access to all these capabilities without installing any software. For code formatting before comparing, try our JSON Formatter, Markdown Preview, or Case Converter.

the Output

In the diff output, green lines represent additions (text that exists in the modified version but not the original). Red lines represent deletions (text that was in the original but removed in the modified version). Unmarked lines are unchanged and provide context for the changes around them.

Unified Diff Format

When you copy the diff output, it follows the unified diff format used by Git and most version control systems. Lines beginning with + were added, lines beginning with - were removed, and unmarked lines provide context. This format can be shared with teammates or saved for later reference.

How to Use the Diff Checker

To use the Diff Checker, follow these steps:

1. Paste the original text into the left (or top) input area.

2. Paste the modified text into the right (or bottom) input area.

3. Choose a diff mode: Line Diff, Word Diff, Character Diff, or Ignore Whitespace.

4. View the result, where added lines appear in green, removed lines in red, and unchanged lines in the default color.

5. Copy the output by clicking the 'Copy' button to get the unified diff as plain text.

  • Paste original text into the left input area.
  • Paste modified text into the right input area.
  • Choose a diff mode.
  • View the color-coded diff output.
  • Copy the unified diff output.

What This Tool Does

The Diff Checker compares two blocks of text and produces a color-coded visualization of the differences. It uses a longest common subsequence (LCS) algorithm to determine the minimal set of changes needed to transform the original text into the modified text. The output clearly marks additions, deletions, and unchanged content so you can quickly identify what changed.

When to Use the Diff Checker

Use the Diff Checker when you need to compare two texts and identify differences. It is useful for developers, content editors, and anyone who needs to track changes in code, documents, or configurations.

How It Works

The Diff Checker uses a longest common subsequence (LCS) algorithm to determine the differences between two texts. The LCS represents the portions of text that are identical in both inputs. Once the LCS is computed, everything not in the LCS is either an addition (in the modified text but not the original) or a deletion (in the original but not the modified). The tool then highlights the differences in the output.

Tips, Edge Cases, and Limitations

Tips:

1. Use the Ignore Whitespace option when comparing code that has been reformatted with different indentation styles.

2. The tool runs entirely in your browser, so your data is never sent to a server.

3. The output follows the unified diff format, which can be shared with teammates or saved for later reference.

Edge Cases:

1. The tool may not handle very large texts efficiently.

2. The LCS algorithm may not always find the most intuitive set of changes, especially for complex texts.

Limitations:

1. The tool does not support binary files or images.

2. The tool does not provide a graphical interface; it is accessed through a web browser.

Frequently Asked Questions

A diff checker compares two blocks of text and produces a color-coded visualization of the differences.
No, everything runs in your browser, so your data is never sent to a server.
Line diff compares text line by line, word diff highlights individual word changes within lines, and character diff shows every character difference.
The Ignore Whitespace option normalizes spacing before comparing, useful when only content matters.
Yes, you can copy the output by clicking the 'Copy' button to get the unified diff as plain text.

Quick reference

Diff Checker Quick Reference
Parameter Expected Value Actual Value Result
File Path /project/docs/requirements.txt /project/docs/requirements.txt Match
Line Number 15 15 Match
Content numpy==1.21.0 numpy==1.21.0 Match
Case Sensitivity true true Match
Encoding utf-8 utf-8 Match
Line Endings \n \r\n Mismatch