Text Compare
Diff checker with highlights
What is Text Compare?
Highlight the differences between two pieces of text — code, prose, logs, CSV, JSON, anything — entirely in your browser. Line-by-line diff with word- or character-level inline highlighting on changed lines, plus a stats strip showing additions, removals, and similarity percentage. Options for ignoring case and whitespace make it practical for comparing code with different indentation or prose with minor formatting drift. Nothing is uploaded; the diff runs locally with diff-match-patch.
How do I use Text Compare?
- Paste the original text on the left and the changed text on the right.
- Pick precision (Word or Character) and toggle Ignore case / Ignore whitespace as needed.
- Click Find difference to see the side-by-side or unified diff.
- Use Go to first change, Disable line wrap, and Copy / Download to inspect or export the result.
Text Compare by the numbers
- Algorithm
- LCS with character refinement
- Max comfortable size
- ~500 KB per side
- Modes
- Line + inline character
- Toggles
- Ignore case, ignore whitespace
- Export
- Unified diff, copy-to-clipboard
Common use cases for Text Compare
- Reviewing edits on a contract before countersigning.
- Comparing two versions of an API response to find breaking changes.
- Spotting plagiarism by diffing a student submission against a reference.
- Tracing a single typo between a draft and a published article.
- Generating a review comment with explicit before/after excerpts.
Common pitfalls and how to avoid them
- Whitespace-only changes mask real edits — Toggle "Ignore whitespace" — useful for comparing code with different indentation or reformatted text.
- Large texts produce slow diffs — The algorithm is O(n·m); 500 KB vs 500 KB takes noticeable seconds. Split by paragraph if you hit slowdowns.
- Binary files look garbled — Diff only human-readable text. For binaries, compare hashes with Hash Generator instead.
When should I use Text Compare?
Text Compare is right when you need a diff between two snippets. For merging text files into a single cleaned version, use Dedup Lines or Sort Lines. To compare JSON structurally rather than textually, pretty-print both with JSON Beautifier first and then diff them.
Can I compare code, not just prose?
Yes — the diff is line-based and either word- or character-aware on changed lines, so it works for any text. Toggle "Ignore whitespace" for whitespace-insensitive comparisons (useful for code with varying indent) and pick Word or Character precision for the inline highlights.
What algorithm does the diff use?
Google's diff-match-patch (a Myers-style differ) running entirely in your browser. Line-level diffs use the linesToChars encoding for speed; inline highlights inside changed lines are diffed at word or character granularity per your precision setting.
Does any text leave my computer?
No. Text Compare runs 100% client-side — there is no API call, no upload, and no server processing. Open your browser's Network tab while you compare to verify.
Is my file uploaded anywhere?
No. Everything runs in your browser. Your files never leave your device, and there is no server component for this tool.