Diff Checker

// compare two texts · highlight added · removed · unchanged lines · nothing leaves your browser

original text
modified text
diff result

What is a diff checker?

A diff checker compares two versions of text and highlights what changed — lines added, removed, or unchanged. It's essential for code reviews, comparing document versions, spotting API response changes, or verifying that a refactor didn't accidentally change logic.

How to use this tool

  • Paste your original text in the left panel
  • Paste the modified text in the right panel
  • Click Compare to see the diff
  • Green lines were added, red lines were removed
  • Gray lines are unchanged

How diff algorithms work

The core algorithm behind most diff tools is the Longest Common Subsequence (LCS) algorithm. Given two texts, it finds the longest sequence of lines that appear in both, in the same order. Everything not in this common sequence is either an addition (in the new text but not the old) or a deletion (in the old text but not the new).

This is the same algorithm used by Git, the Unix diff command, and code review tools like GitHub's pull request view. The output is called a "unified diff" format — lines starting with + were added, lines starting with - were removed, and unchanged lines provide context.

Common use cases include comparing two versions of a configuration file, reviewing changes in a document before sending it, debugging API responses that should be identical, comparing database schema versions, and verifying that a minified file contains the same content as its source.

Tips for effective text comparison

When comparing JSON or code, format it first using the JSON formatter or a code formatter. Comparing minified vs formatted versions of the same content will show every line as different even though the data is identical. Consistent formatting makes the diff show only meaningful changes.

For large files, focus on the changed sections rather than reading every unchanged line. The statistics (added, removed, unchanged) give you a quick sense of how significant the changes are. A diff showing 2 added and 1 removed line in a 500-line file is a minor change; a diff showing 200 changes is substantial and warrants careful review.

Frequently Asked Questions

Does this work for code?+
Yes — paste any code, JSON, config files, or plain text. The diff is line-based so it works the same regardless of whether you're comparing prose, Python, YAML, or SQL.
Is my text kept private?+
Yes. All comparison happens in your browser using JavaScript. Nothing is sent to any server. This makes it safe to compare sensitive config files, private documents, or proprietary code.