Get started
HomeText & ContentText Compare
Text & ContentRuns in your browser · files never uploaded

Text Compare

Diff checker with highlights

4.7· 72 votes
A text-compare tool highlights the differences between two blocks of text at the line and character level. StuHub uses a longest-common-subsequence algorithm similar to Unix diff, with inline character highlighting on changed lines so small edits stand out inside large paragraphs.
Your file never leaves this browser. Everything runs on your device — no uploads, no server storage, no retention.How it works →
+10~3
Original
1
The quick brown fox jumps over the lazy dog.
2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
3
Sed do eiusmod tempor incididunt ut labore et dolore.
4
Ut enim ad minim veniam, quis nostrud exercitation.
5
Duis aute irure dolor in reprehenderit in voluptate.
Changed
1
+
The quick red fox jumped over the lazy cat.
2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
3
+
Sed do eiusmod tempor incididunt ut magna aliqua.
4
Ut enim ad minim veniam, quis nostrud exercitation.
5
+
Excepteur sint occaecat cupidatat non proident.
6
+
Sunt in culpa qui officia deserunt mollit anim.
Added line Removed line Inline added Inline removed

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?

  1. Paste the "before" text into the left panel and the "after" text into the right panel.
  2. Toggle "Ignore whitespace" and "Ignore case" as needed.
  3. Read the inline diff; green is additions, red is removals.
  4. 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 editsToggle "Ignore whitespace" — useful for comparing code with different indentation or reformatted text.
  • Large texts produce slow diffsThe algorithm is O(n·m); 500 KB vs 500 KB takes noticeable seconds. Split by paragraph if you hit slowdowns.
  • Binary files look garbledDiff 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.

Frequently asked
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.

Related in Text & Content
JSON Beautifier
JSON Minifier
XML Formatter
XML to JSON
YAML Formatter
Case Converter
Word Counter
Character Counter