Text Diff
Paste the original text as A and the changed text as B, then get the differences by line, word, or character. Choose a unified-diff view with @@ hunk headers or an inline view that marks [-removed-] and {+added+} spans in place.
🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.
Options
Your result will appear here
Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.
How it works
Two texts, three comparison units
The workbench input is text A; text B goes in the “Text B” option box. Compare by lines, words or characters and the tool diffs at that granularity. The stats count added and removed units for whichever you chose — lines, words or characters.
Unified or inline
Unified output produces a conventional diff with --- and +++ markers and @@ hunk headers, ready to paste into a patch. Inline output instead marks changed spans in place with [-removed-] and {+added+} wrappers, keeping the surrounding text intact — best when only a word or a character changed.
Choosing a granularity
Line mode is the default and right for source, config and logs. Word mode isolates a changed identifier inside a long line. Character mode is the finest and useful for spotting a single mistyped digit, though on long inputs it is dense and harder to read.
Empty and trailing-newline details
If text B is empty the tool treats it as an empty document, so every line of A shows as removed. Trailing newlines are normalised before a line diff, so a file differing only by a final newline does not report a spurious change. Whitespace inside a line is preserved, so indentation differences are real changes.
Comparison stays on your device
Both texts are diffed inside this tab by a bundled library — no upload and no history. That matters when the two sides are a private key, a production config or a customer record.
Questions
How do I supply the second text?
The workbench input is text A. Put text B in the "Text B" option box. If B is left empty the tool treats it as an empty document.
What do the stats mean?
Additions and deletions count the changed units for the chosen granularity — added/removed lines, words, or characters.
Which view should I use?
Unified is best for line-level review and pasting into patches. Inline is best for spotting small word or character edits within a sentence.
Related tools
See categoryJSON Diff
Structural diff of two JSON documents, showing added, removed and changed values by path.
Regex Tester
Test a JavaScript regular expression against text — highlight, list matches, replace or split.
Find and Replace
Replace text by plain string, whole word, or regular expression, with optional case folding.
Sort Lines
Sort lines alphabetically, numerically, by length, naturally, or shuffle them.