Loading...
Loading...
Loading tool...
Compare two blocks of text and highlight the differences line by line.
Comparing two versions of a file is one of the most common tasks in software development. Whether you are reviewing a pull request, debugging a configuration change, or verifying that a database migration script was applied correctly, a reliable diff tool saves hours of manual line-by-line comparison. This online diff checker brings that capability to your browser with zero setup required.
The core of any diff tool is the Longest Common Subsequence (LCS) algorithm. Given two sequences of lines, LCS finds the longest ordered set of lines that appear in both versions. Everything not in the LCS is either an addition or a deletion. This tool extends LCS with word-level diffing: when two adjacent lines are modified (one removed, one added), it runs a secondary diff on the individual words to highlight exactly which parts changed within the line.
Code review: Paste the before and after versions of a function to see exactly what changed. Configuration auditing: Compare server configs, .env files, or Kubernetes manifests to spot unintended differences. Content editing: Writers and editors can compare document drafts to track revisions. API response debugging: Compare expected vs actual JSON responses to find discrepancies.
Use the "Ignore whitespace" option when comparing code that has been reformatted - this focuses the diff on meaningful changes rather than indentation shifts. For large files, consider diffing only the relevant sections rather than the entire file. The line numbers on both sides help you quickly locate changes in the original documents.
Pro includes file diff, folder diff, syntax-highlighted comparisons, and merge conflict resolution.
The tool compares two texts line by line using an LCS (Longest Common Subsequence) diff algorithm to find the minimal set of changes. Additions are shown in green, removals in red, and word-level differences are highlighted within changed lines for precise change tracking.
Yes. The diff checker works with any text including source code in any programming language, configuration files (JSON, YAML, TOML), SQL queries, Markdown, and plain text documents. The monospace font preserves code formatting.
Green lines with a + prefix indicate additions (text present in the modified version but not the original). Red lines with a - prefix indicate deletions (text present in the original but removed in the modified version). Unchanged lines have no color or prefix.
Yes. Toggle the 'Ignore whitespace' checkbox to collapse multiple spaces and ignore trailing whitespace when comparing. You can also toggle 'Ignore case' to make the comparison case-insensitive.
The tool handles files up to 5,000 lines with the full LCS algorithm. For larger inputs it automatically switches to a faster line-by-line comparison to keep the browser responsive.
Diff Checker is part of BriskTool's collection of free online tools. All processing runs entirely in your browser for maximum privacy and speed.