You just rewrote a paragraph. Or edited a config file. Or received a revised document from a colleague. Now you need to know: exactly what changed?
Reading both versions side by side is tedious and error-prone. You will miss things. Diff tools exist precisely for this — and you don't need to install anything.
What is a text diff?
A "diff" is a summary of the differences between two versions of a text. Originally a Unix command-line tool (diff), the concept is now everywhere: Git uses it to show code changes, Wikipedia uses it to show edit histories, and code review tools use it to highlight what changed between pull requests.
A diff shows you:
- Added lines (highlighted in green)
- Deleted lines (highlighted in red)
- Unchanged lines (shown for context)
This makes it immediately clear what was added, removed, or modified — without reading everything word by word.
The algorithm behind it: LCS
Most diff tools — including this one — are based on the Longest Common Subsequence (LCS) algorithm. The idea is to find the longest sequence of lines that appear in both texts in the same order, and treat everything else as an addition or deletion.
For example, given:
Original:
The quick brown fox
jumps over the lazy dog
Modified:
The quick red fox
leaps over the lazy dog
The LCS finds The quick and fox in the first line, and the second line is unchanged. The diff reports:
-
brown→ deleted,red→ added - Second line: unchanged
Modern diff tools operate at the word level within changed lines (called "inline diff"), which makes edits even easier to spot.
When to use a text diff tool
Writing and editing:
- Compare two drafts of an article or essay to review what your editor changed
- Check if a client applied your suggestions correctly
- Review changelog entries before publishing
Development:
- Compare configuration files before and after a change
- Review a file you received against your last known version when you can't use Git
- Quickly audit what a script modified in a text file
Data work:
- Compare two exports of the same data to find discrepancies
- Spot added or removed rows in a TSV or CSV snippet
Inline vs side-by-side view
Most diff tools offer two display modes:
Inline view — both versions are shown in a single column, with additions and deletions interleaved. Easier to scan when changes are scattered across the text.
Side-by-side view — original on the left, modified on the right, with corresponding lines aligned. Better for seeing the shape of what changed at a glance, especially for longer documents.
Useful options: ignoring whitespace and case
Two options make diffs much more useful in practice:
Ignore whitespace — tabs vs spaces, trailing spaces, or re-indented code shouldn't count as meaningful changes. Most good diff tools let you strip whitespace before comparing so you only see structural edits.
Ignore case — useful when comparing text that may have been reformatted (e.g. all-caps headings → title case) or when casing differences aren't semantically important.
Try it in your browser
If you need to compare two texts right now, SnappyTools' Text Diff Checker runs entirely in your browser — nothing is sent to a server. Paste both versions, choose inline or side-by-side view, and see the diff immediately.
You can also:
- Ignore whitespace or case with a single toggle
- Copy the diff as plain text (with +/- prefix markers)
- Use the "Try an example" buttons to see how it works before pasting your own text
No signup, no file uploads, no waiting.
SnappyTools builds free, fast, browser-based tools for developers, writers, and designers. No signup, no data uploaded.
Top comments (0)