Free Online Text Diff Checker

Compare two texts with GitHub-style side-by-side or unified diff view. Support for line, word, and character-level granularity with inline highlighting of exact changes.

edit Original
edit Modified

Paste text in both boxes to see differences

Key Features

computer

GitHub-Style Display

Side-by-side split view or unified view with line numbers, just like GitHub compare.

search

Multiple Granularity

Line, word, and character-level diff with inline highlighting of exact changes.

lock

Privacy Protected

Your text never leaves your browser. All comparison happens locally.

Frequently Asked Questions

Usage
When should I use Word diff instead of Line diff?expand_more
Use Line diff when comparing structured content like code, JSON, or configuration files where changes typically span entire lines. Use Word diff when comparing prose, documentation, or when only a few words changed within otherwise identical lines — for instance, when comparing two versions of a paragraph where only names or numbers were updated. Word diff provides inline highlighting so you can see exactly which word changed without scanning the entire line.
How is this different from the Diff Tool page?expand_more
The Text Diff Checker focuses on line, word, and character-level visual comparison with inline highlighting of differences within lines. The Diff Tool is designed to produce unified diff output in the standard patch format (with @@ -l,s +l,s @@ hunks) similar to the `diff -u` command. Use Text Diff for visual review; use Diff Tool when you need a standard patch file for applying changes.
Why does the diff show many lines as changed when only one word differs?expand_more
In Line diff mode, an entire line is marked as changed if any character within it differs. This is by design — line mode compares whole lines as atomic units. To see the exact word that changed within a line, switch to Word mode, which performs a finer-grained comparison and highlights only the differing words while keeping matching words unmarked within the same line.
Can I diff large files (e.g., 10,000+ lines)?expand_more
The tool runs entirely in your browser using the Myers diff algorithm implemented in JavaScript. Performance degrades quadratically with text size; comparing two 10,000-line files may take several seconds and can cause the browser tab to appear frozen. For files larger than 5,000 lines, consider using a native tool like `git diff`, `diff`, or a desktop diff application.
How does word-level diff handle punctuation attached to words?expand_more
In Word mode, words are split by whitespace, so punctuation attached to a word (like "hello," or "world.") is treated as part of that word. This means "hello," vs "hello!" would show the entire token as changed. For more precise punctuation handling, use Char mode, which compares individual characters and highlights exactly which punctuation mark changed.