Your data is never sent to a server or stored anywhere. All processing happens in your browser.

Diff Checker — Line-by-line Compare with Highlight

Diff Result
+0 added -0 removed 0 unchanged
View Mode

How to Use


Paste the original text on the left and the modified text on the right. The tool instantly compares them line by line and shows a unified diff view. Green lines are additions, red lines are deletions, and gray lines are unchanged.

How It Works


This tool uses the Longest Common Subsequence (LCS) algorithm to find the minimal set of changes between two texts. It compares line by line, identifying which lines were added, removed, or kept unchanged. This is the same fundamental approach used by tools like git diff and Unix diff.

Use Cases


  • Code review: check your changes before creating a pull request to catch unintended modifications
  • Config file changes: compare before-and-after versions of nginx.conf, docker-compose.yml, or similar files to spot errors
  • Document revision tracking: compare contract or specification drafts to identify exactly which clauses or wording changed
  • Data validation: compare CSV or JSON export results to verify data integrity

Reading the Diff


Lines with a green background are additions — text that exists only in the modified version. Lines with a red background are deletions — text that was removed from the original. Gray lines are unchanged context, shown to help you understand where changes occurred. The unified view shows additions and deletions in a single column, while side-by-side view places the original and modified text next to each other.

Tips for Better Diffs


  • Normalize trailing whitespace and tabs in both texts before comparing to focus on meaningful changes only
  • For unordered lists (like CSV rows), sort both texts before pasting to make the diff cleaner and easier to read
  • Use side-by-side mode for long texts — it makes it easier to follow corresponding lines across both versions

Privacy


All comparison happens entirely in your browser. No text is sent to a server, stored, or logged. You can safely compare sensitive documents, configuration files, or source code.

FAQ


What is the difference between line-level and character-level comparison?

This tool compares line by line, classifying each line as added, removed, or unchanged. It does not do character- or word-level diffing that highlights which characters changed within a line. This is the same line-based approach used by git diff and Unix diff.

Is it safe to paste sensitive documents or source code?

Yes. All comparison runs entirely in your browser, and no text is ever sent to a server, stored, or logged. You can safely compare contracts, configuration files, and proprietary code.

Is there a limit on how long the texts can be?

There is no explicit character limit, but the LCS algorithm grows more expensive as the number of lines increases. It handles up to a few thousand lines comfortably; much larger files may become noticeably slower.

When should I use unified view versus side-by-side view?

Unified view stacks additions and deletions in a single column, which is good for scanning changes vertically. Side-by-side view places the original and modified text next to each other, making it easier to follow corresponding lines in long texts.

Are whitespace and indentation differences detected as changes?

Yes. Trailing spaces, tabs, and indentation differences are treated as distinct lines. If you only want to see meaningful changes, normalize the whitespace in both texts before comparing to keep the diff clean.