Dev-Utilities logoDev-UtilitiesAbout

Text Diff Checker

Paste two texts to compare them line by line. Added lines are highlighted green, removed lines red.

About the Text Diff Checker

A text diff tool compares two versions of a document and highlights the differences — which lines were added, which were removed, and which remain unchanged. It is an essential tool for reviewing changes to code, configuration files, documentation, log snippets, or any text that evolves over time.

How the diff algorithm works

This tool uses the Longest Common Subsequence (LCS) algorithm to compute the minimal edit distance between two texts. The LCS identifies the largest set of lines that appear in both documents in the same order, then marks everything else as an addition or deletion. This produces the most compact and readable diff — the same approach used by git diff and most version control systems.

Reading a diff

Lines prefixed with + appear only in the second (right) text — they were added. Lines prefixed with appear only in the first (left) text — they were removed. Unchanged lines are shown in grey and can be hidden to focus on what actually changed. Each line displays its original line number from both sides so you can navigate back to the source quickly.

Common use cases for online text comparison

  • Comparing two versions of a config file before and after a change
  • Reviewing what changed between two log snapshots during an incident
  • Diffing SQL query output or API responses to spot regressions
  • Comparing two documents or reports for editorial differences
  • Verifying that a transformation (e.g. a regex replace) produced the expected output
  • Checking that a minified file matches the original after reformatting
  • Comparing environment variable files across staging and production

When to use a diff tool vs. version control

Git and other version control systems have built-in diff capabilities, but they require a repository and committed history. This text comparison tool is useful for one-off comparisons where version control is not involved — pasting two API responses, comparing copied text from different sources, or reviewing changes to content that lives outside your codebase. It is also useful when you want a clean visual diff without the overhead of git setup or diff command-line flags.

Privacy

Diffing runs entirely in your browser — neither text is sent to any server. Learn more about how Dev-Utilities handles privacy.