Skip to content
Accessibility
Theme
Text size
High contrast
Limit animations
Readable fontAtkinson Hyperlegible
Increased text spacing
Underline links
Always show focus

Runs in your browser — nothing you paste is uploaded.

Text Diff

Compare two blocks of text and see what changed, line by line — added, removed, unchanged. Runs entirely in your browser.


      

What it does

Paste an original version in the left box and a changed version in the right box, and the tool shows a line-by-line diff: + for lines that were added, - for lines that were removed, and a leading space for unchanged context lines. A tally of added and removed lines is shown underneath, and the whole diff can be copied. It is handy for comparing config files, JSON, SQL, CSVs or log snippets where you need to see exactly what moved.

How it works

Both texts are split on newlines and compared with a longest-common-subsequence (LCS) algorithm — the same core idea behind diff and version-control tools. The LCS finds the largest set of lines that appear in the same order in both inputs; everything not on that common path is reported as an addition or a removal. Because it tracks order, moving a block of lines shows up as a removal in one place and an addition in another, rather than as a single "moved" marker.

Gotchas

  • Comparison is exact and case-sensitive. A trailing space or a tab-vs-spaces change makes two lines differ.
  • It is line-based, not word-based: changing one character flags the whole line as removed and re-added.
  • Very large inputs build an n×m table, so comparing two huge files can be slow — trim to the relevant section first.

Worked example

Comparing two .env files, a changed value like DEBUG=false becoming DEBUG=true appears as a - line for the old value directly followed by a + line for the new one, while every untouched setting stays as context. To clean or dedupe a list before diffing, use Line Tools; for comparing structured data, format both sides first with JSON or SQL Formatter so formatting noise doesn't drown out the real changes.

Privacy

Both texts are compared locally in your browser; nothing is uploaded.

Frequently asked questions

Is the diff line-based or character-based?

Strictly line-based. Each line is compared as a whole unit, so a one-character edit marks the entire old line as removed and the entire new line as added. There is no word-level or character-level highlighting within a line.

Does whitespace affect the comparison?

Yes. Lines are matched exactly, so trailing spaces, a tab-versus-spaces difference, or a changed indent make two otherwise identical lines count as different. Normalise whitespace first if you only care about content changes.

How are the changes marked?

Added lines (present only in the Changed text) are prefixed with +, removed lines (present only in the Original) with -, and unchanged lines are shown as context with a leading space. A count of added and removed lines appears underneath.

Related tools