Free & Private Online Browser Utility

Text Diff & Compare Tool

Compare two blocks of text and see exactly which lines were added, removed, or unchanged, using a client-side Longest Common Subsequence algorithm. The diff highlights additions in green and deletions in red at line granularity, making it straightforward to review document revisions, code snippet changes, or configuration file edits. All processing runs entirely in browser memory with no text uploaded to any server.

How to use

  1. Step 1: Paste Original Text

    Enter the original (before) version of your text in the left panel.

  2. Step 2: Paste Modified Text

    Enter the updated (after) version in the right panel. The diff view updates automatically.

  3. Step 3: Read the Diff Output

    Added lines appear in green, removed lines in red, and unchanged lines in the neutral panel. Copy or download the diff result.

Options explained

Line-by-Line Diff

Compares text split by newline characters and marks each line as added, removed, or kept.

When to use: Use for comparing document drafts, configuration files, code snippets, or legal text revisions.

Unified View

Shows added and removed lines interleaved in a single scrollable output with color coding.

When to use: Use when reviewing changes in a compact format with additions and deletions interleaved.

Worked example

Input: Original text (2 lines) compared against modified text (3 lines)

Output: 4 diff lines produced: 1 unchanged line, 1 removed line, 2 added lines

Measured using the line-by-line Longest Common Subsequence dynamic programming table.

Tips & limits

  • For code diffs, paste with consistent indentation in both panels — mixed tabs and spaces create false differences.
  • Blank lines count as separate lines in the diff. Trailing newlines can affect the changed-line count.
  • The diff is sensitive to whitespace. If results show many false changes, trim trailing spaces before pasting.

Common problems

Too many lines show as changed when only a word moved

The tool compares at line level, not word or character level. A single word change on a line marks the whole line as deleted and re-added.

Diff output is empty for pasted text

Check that both panels contain text. An empty panel means one version has zero lines, so all lines in the other panel appear as additions.

Frequently Asked Questions (FAQ)

What algorithm does the text diff use?

It uses the Longest Common Subsequence (LCS) algorithm applied at line level. LCS finds the largest set of lines that appear in both versions in the same order, marking the rest as additions or deletions.

Can I diff code files?

Yes. Paste the contents of any plain text or code file into each panel. The diff is language-agnostic and works for JavaScript, Python, JSON, YAML, HTML, or any line-based format.

Is my text sent to a server?

No. The LCS algorithm and all rendering run inside your browser. Neither version of your text is transmitted over the network.

Does it support word-level or character-level diff?

The current engine operates at line level. Lines that changed appear as a pair of deletion and addition. Word-level highlighting within a line is not available.

Files never leave your device; calculations and transformations happen locally.

Last reviewed: 2026-10-16 · Build: deb3bc0