Compare two text files with line-by-line, word-by-word, and character-level diff
Diff algorithms compute the shortest edit script to transform text A into text B—insertions, deletions, moves. Classic approach: Myers diff algorithm (1986), which finds longest common subsequence (LCS) using dynamic programming, then derives minimal edit set. This tool likely uses a JavaScript diff library (jsdiff, diff-match-patch) implementing Myers or Hunt-McIlroy. Line-based diff splits inputs on newlines, compares line hashes (fast), highlights changed lines. Character-based diff (slower) compares within modified lines to show exact character differences. Unified view mimics git diff output (+/- prefixes); split view shows side-by-side. Ignore whitespace option strips spaces/tabs before comparison—useful for code reformatting where logic unchanged.
Learn more about this tool and related topics in our blog.
Clean up messy drafts and automate your writing workflow. 10 essential text utilities that will save you hours of manual formatting.
Privacy isn't a perk, it's a requirement. See why top developers are ditching cloud converters for local-first browser utilities.
This tool uses client-side WebAssembly to ensure your data never touches a server. Secure, fast, and 100% private by design.
Paste original text (version A) into left panel.
Paste modified text (version B) into right panel.
Diff library splits on \n, computes LCS, generates edit script.
Green highlight = addition (+lines in version B), red = deletion (-lines in version A).
Character diff shows inline differences: 'Hello World' → 'Hello Earth' highlights 'World'→'Earth'.
See what actually changed in that pull request
Original: function hello() { return 'Hi'; }Modified: function hello() { return 'Hello World!'; } — Green highlight on 'Hello World!'Track what edited between draft versions
Draft 1 vs Draft 2 with several wording changes
Red for removed text, green for new text, side-by-side view
Verify configuration changes before deploying
Old config.json vs new config.json
Highlighted lines showing added/removed settings
Review teammate's code changes before approving.
Understand what changed between two commits.
See what your coauthor changed in a document.
Verify someone didn't break production config.
We use the Myers diff algorithm (same as Git!): 1. **Find common parts**: Identify text that's identical in both files 2. **Mark differences**: Everything else is a change 3. **Optimize**: Try to minimize the number of change blocks **Result**: Most human-readable representation of what actually changed. Why this matters: The algorithm tries to show meaningful changes, not just character-by-character comparison.
**Split View (Side-by-side)**: - Original on left, modified on right - Easy to see both versions at once - Great for big blocks of changes - Can be wide on small screens **Unified View (Inline)**: - Single column with +/- markers - Red lines (removed), green lines (added) - Same as GitHub/Git diffs - More compact, better for mobile Pick based on your preference!
Whitespace can mess up diffs if not handled: **What counts as whitespace**: Spaces, tabs, line breaks **Issues it causes**: - Tab vs 4 spaces: Looks same, diffs differently - Trailing spaces: Invisible but shows as change - Line ending differences (\n vs \r\n) **Solution**: Use 'Ignore whitespace' to focus on actual content changes, not formatting.
Power up your workflow with related utilities.
Instantly change text between UPPERCASE, lowercase, Title Case, and more.
Write professional READMEs and blog posts with a live side-by-side preview. Supports GitHub Flavored Markdown and one-click PDF export.
Beautify, validate, and debug messy JSON data instantly. Color-coded syntax highlighting and real-time error detection for developers.
Learn more about this tool and related topics in our blog.
Clean up messy drafts and automate your writing workflow. 10 essential text utilities that will save you hours of manual formatting.
Privacy isn't a perk, it's a requirement. See why top developers are ditching cloud converters for local-first browser utilities.