Skip to main content

Text Diff

Compare two texts side-by-side with line-by-line and word-level diff highlighting

Options
Original
Modified
Diff Output

Paste text in both panes to see the diff

Frequently Asked Questions

Is my text sent to any external server for comparison?

No. The Text Diff tool performs comparisons entirely in your browser using a pure-JavaScript implementation. Your documents never leave your device, making it safe for comparing confidential documents, code, or configuration files.

What diff algorithm does this tool use?

The tool uses a line-level LCS (Longest Common Subsequence) diff algorithm that produces minimal, human-readable diffs. For word-level changes, it applies a secondary token-level diff within changed lines to highlight the exact words that were added, removed, or modified.

Can I compare code files or JSON documents?

Yes. The diff view works on any plain text including source code, JSON, YAML, Markdown, and config files. Use the Ignore Whitespace toggle to focus on semantic changes, or export a Unified Diff for use with standard patch tools.