Compare Text Files Online — Free & Private
Drop two text files — .txt, .md, .csv, .log, .json, .yaml, or source code — and see every difference highlighted word by word. SnapTextCompare reads files locally with the browser's File API; nothing is ever uploaded.

No comparison yet. Paste or upload text in both fields below — results appear here automatically, and nothing is calculated until you do.
Compare your two texts
Original Text (A)0 words
Modified Text (B)0 words
Supported Text File Formats
Plain text
.txt and .md — decoded as UTF-8. Convert RTF to plain text first.
Code & config
.js, .ts, .py, .go, .json, .yaml, .xml, .env, .conf.
Data & logs
.csv, .tsv, .log, .ndjson — perfect for spotting drift.
When You'd Compare Text Files
Config drift. Diff a working .env or nginx.conf against a broken one to find the offending line in seconds. Indentation, trailing whitespace and quote style are all preserved, so silent parser errors become obvious.
Log analysis. Compare two log windows to spot new error patterns after a deploy. Pair with line-level diff so each log line is treated as an atomic unit — far more readable than word-level on logs.
CSV reconciliation. Compare yesterday's export against today's to see exactly which rows changed. Switch to line mode and changed rows surface immediately; switch to word mode to see which column inside a row changed.
Code review without git. Compare two snippets without opening an IDE or pushing a branch. Useful for ad-hoc reviews, gist comparisons, or pasting from Stack Overflow vs your local version.
Documentation versioning. Diff two README revisions before publishing to confirm only the intended sections were touched.
Translation QA. Diff an original locale file (en.json) against a translated one (fr.json) to verify all keys are still present and nothing was accidentally removed.
Word vs Line Diff — Which to Pick?

| Mode | Best for | Avoid when |
|---|---|---|
| Word | Prose, configs, short scripts | Comparing whole-line code rewrites |
| Line | Source code, CSVs, logs | Spotting single-word edits inside a paragraph |
| Character | Catching typos, swapped digits, ID mismatches | Reviewing large rewrites — output gets noisy |
How the Browser Reads Your Text Files
Supported plain-text formats are read with file.text() and decoded as UTF-8. Other encodings must be converted in your editor first. Binary containers such as XLSX and ZIP are not text imports.
Word mode groups whitespace and non-whitespace runs; it does not perform linguistic segmentation. Line mode groups newline-delimited lines. CRLF versus LF differences are detected, not automatically erased; convert line endings in your editor if they are irrelevant.
The diff runs on the page's JavaScript thread. Large inputs may temporarily slow editing; compare smaller sections when needed. File content is never sent to a server. Recent comparisons are saved in local History until cleared.
Text File Comparison Tips
Normalise line endings before comparing. If cross-platform line endings are irrelevant, convert both in your editor or use dos2unix. Ignore whitespace handles spaces and tabs, not general line-ending conversion.
Strip trailing whitespace. Editors silently add or remove trailing spaces. Toggling "Ignore whitespace" filters these out so only meaningful changes remain.
For JSON, format both sides first. Run each file through a formatter so structural keys land on the same lines — otherwise a single re-ordering shows as a complete rewrite.
For CSVs with reordered rows, sort both files (e.g. sort file1.csv > sorted1.csv) before diffing to surface only real value changes.
For very large logs, filter the relevant time window first. Browser memory and responsiveness depend on your device and the change density.
Related comparison tools
How SnapTextCompare works
Diff engine
Google's diff-match-patch (Apache 2.0), running in your browser. Character mode diffs raw characters; word and line modes encode tokens or lines first and diff those, then decode the result.
Similarity & importance
Similarity = 1 − Levenshtein / max(len). Importance weighs each change by category — money and dates score 90+, punctuation scores 3. Fixed rules classify a given diff; they do not determine meaning or whether an edit is safe.
Privacy
Files are read with the HTML5 File API and processed in your browser. No network request is ever made with your content — verifiable in the Network tab of your browser's DevTools. Full recent comparisons are saved in this browser's local History, even after closing the tab. Clear History to remove them.
PDF extraction uses pdf.js (Mozilla). Word extraction uses mammoth.js. Plain-text files are decoded as UTF-8. Convert other encodings first. CRLF versus LF differences remain detectable; normalise line endings in your editor if they are irrelevant.
Text File Comparison FAQ
Common questions about comparing text files online.