sitekits.dev
press ⌘K to switch tools
TEXT

Text Diff Checker

Compare two texts and visualize the differences line by line.

local
text-diff
§01 ABOUT THIS TOOL

Overview

This tool compares two versions of a text line by line and renders a unified diff: removed lines are prefixed with - and tinted red, added lines with + and tinted green, unchanged lines stay plain. A counter above the result shows the total number of added and removed lines. It is useful for reviewing config changes, comparing SQL dumps, or checking what an editor or formatter changed.

How to use

  1. Paste the first version into Original.
  2. Paste the second version into Changed.
  3. The diff appears below automatically, with a +N / -N summary of added and removed lines.

Examples

  • Original color: red vs. Changed color: blue- color: red and + color: blue
  • Adding a line to a .env file shows only + NEW_FLAG=true; untouched lines are listed without a sign.

Notes

Matching is exact per line: differences in trailing spaces, tabs vs. spaces, or line endings register as changes. Normalize whitespace first if you only care about content.

The LCS comparison builds a table with one cell per pair of lines, so the work and the memory grow with the product of the two lengths — not with their sum. Above four million cells (roughly 2,000 lines against 2,000) the tool refuses the comparison and says so, rather than freezing the tab while it tries to allocate hundreds of megabytes. Diff a smaller section instead.

FAQ
Is the text I paste uploaded anywhere?
No. The diff is computed entirely in your browser with a JavaScript LCS algorithm. Nothing is sent to a server, so it is safe for config files, logs, or code you cannot share.
How are differences detected?
The tool splits both inputs into lines and runs a longest-common-subsequence (LCS) comparison, the same family of algorithm used by classic diff utilities. Lines are matched exactly, so trailing whitespace counts as a change.
Does it show character-level differences within a line?
No. Comparison is line-based. A line with any change appears as one removed line and one added line rather than highlighting the changed characters inside it.