Skip to content
epitometool

Text diff

Text utilities

Compare two texts and highlight added or removed lines.

Updated

Inputs

Side-by-side

+2-14 unchanged
AOriginalBChanged
1 function add(a, b) {1 function add(a, b) {
2+ // sum the args
2 return a + b;3 return a + b;
3 }4 }
4 5
6+console.log(add(2, 3));
5-console.log(add(1, 2));

Quick start

How to compare two pieces of text

Paste both versions, see additions and deletions side-by-side with line numbers.

  1. Step 1
    Paste original

    Drop the baseline version into the left textarea.

  2. Step 2
    Paste changed

    Drop the modified version into the right textarea.

  3. Step 3
    Review the diff

    Two-column view shows unchanged, added (green) and removed (red) lines with line numbers from each side.

In-depth guide

Text diff — side-by-side line comparison

Compare two pieces of text line by line in a GitHub-style two-column view. Built for code review, config audits and prose-drafting — anywhere line-level granularity beats character-by-character.

Common uses

  • Code review — paste old and new versions of a function to see exactly what changed.
  • Config audits — diff nginx.conf from staging vs production.
  • Prose editing — compare draft revisions of a blog post or contract.
  • Translation review — line up source and translated strings.

How to read the diff

  • Green + on the right side — line added in B.
  • Red - on the left side — line removed from A.
  • Both sides shown together — line modified (matched delete + insert).
  • Both sides equal — unchanged line. Line numbers in each side reflect that side's actual line.

Limits and tips

  • Whitespace matters — trailing spaces and inconsistent indenting will show. Normalise first if you want to ignore them.
  • Long lines — wrap or scroll horizontally. The diff doesn't break long lines apart.
  • Performance — the LCS DP is O(n × m). Inputs over ~5,000 lines per side may slow your browser.
  • Word-level highlights — not shown. We mark only "this whole line changed". For mid-line precision, copy the changed lines into the string-diff tool.

Frequently asked questions

Does this tool send my text anywhere?

No. The diff is computed in your browser. Useful for diffing config files, prose drafts or code where you don't want to upload to a hosted service.

How does it differ from string-diff?

text-diff is line-level — each line is a unit of comparison. Use it for code, config, prose. string-diff goes character-by-character — better for short strings, version numbers, single sentences.

Does it ignore whitespace?

No, whitespace is significant — a changed indent or trailing space shows as a diff. Normalise inputs (trim trailing whitespace, convert tabs) first if you want to ignore those.

What about line ending differences (CRLF vs LF)?

We split on \r?\n so the line endings themselves are stripped before comparison. Two files with the same lines but different endings will compare equal.

How are added and removed counts computed?

Each delete is +1 removed, each insert is +1 added, a paired delete-insert on the same row counts as both. Numbers are line counts, not character counts.

Does it produce a unified-diff patch I can apply?

Not yet — output is a side-by-side view only. For patch-format output use the git diff or diff command from your terminal.

Keep exploring

More tools you'll like

Hand-picked utilities that pair well with the one you're on — all free, client-side, and zero-signup.