Text Diff Online — Side-by-Side Line Diff

Compare two free-text blocks with highlighting at line and word level, side by side (the default) or unified. You can ignore differences in whitespace or letter case. It complements JSON Diff, and everything stays local within the documented size limits.

Loading…
Text diff
Line-level diff through a custom comparator on top of the npm diff library (diffArrays and diffWordsWithSpace for word-level highlighting). It renders side by side or unified, with caps of 100,000 characters and 5,000 lines per pane.

How comparison works

Paste text on the left and right, optionally ignore differences in whitespace or letter case, then select Compare. Changed lines get word-level highlighting, and you can switch between Split and Unified layout at any time. Copy or download the unified +/- diff.

Options

Ignore whitespace
Passes a whitespace-aware comparator to the diff engine. Lines that differ only by leading or trailing spaces, or by extra internal spaces or tabs, are treated as equal.
Ignore case
Compares lines without regard to letter case, so lines that differ only by case count as equal. The original casing is still shown in the result.

Examples

Changed line

Left

a b

Right

a c

Append line

Left

one two

Right

one two three

Related tools

For structural JSON, use JSON Diff. Back to the utilities hub.

Text diff FAQ

Free-text comparison

Split or Unified: which is the default?

Split (side by side) is the default and the most detailed view. Switch to Unified for a single-column layout in the style of git diff. Both share the same word-level highlighting on changed lines.

Size limits?

100,000 characters or 5,000 lines per pane. Beyond that you get a too_large error.

3-way merge / apply patch?

Not supported. The tool only compares two texts and does not merge or apply patches.

JSON Diff vs text?

JSON Diff compares JSON structure. This tool compares free text, line by line.

Windows CRLF vs Unix LF?

Line endings are normalized to LF before the comparison, so pasting Windows text against Unix text does not create false positives from \r alone.

Timestamps, UUID, ULID, Nanoid, cron, passwords, regex, slugs, number bases, letter case, text diff, chmod and Lorem Ipsum, all in your browser.