Text Compare
Diff checker with highlights
What is Text Compare?
Highlight the differences between two pieces of text — code, prose, logs, CSV, JSON, anything. Line-by-line diff with character-level inline highlighting on changed lines, plus a statistics strip showing adds, deletes, and similarity percentage. Options for ignoring case and whitespace make it practical for comparing code with different indentation or prose with minor formatting drift.
How do I use Text Compare?
- Paste the "before" text into the left panel and the "after" text into the right panel.
- Toggle "Ignore whitespace" and "Ignore case" as needed.
- Read the inline diff; green is additions, red is removals.
- Optionally save the diff for sharing.
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 character-aware, so it works for any text. Toggle "Ignore whitespace" for whitespace-insensitive comparisons (useful for code with varying indent).
What algorithm does the diff use?
We use a longest-common-subsequence algorithm similar to Unix diff, with inline character-level highlighting on changed lines so small edits stand out.
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.