Text Compare
Compare two versions of any text and see exactly what changed. Uses the same diff algorithm as git, so an inserted line does not report everything after it as changed, with inline and side-by-side views and word-level highlighting.
Text ToolsHow to use Text Compare
- Paste the original into the left panel and the new version into the right.
- The differences appear below as you type.
- Switch between Inline and Side by side depending on how large the change is.
- Use Swap sides if you pasted them the wrong way round.
- Copy the result as a unified-style diff with + and - markers.
Examples
An inserted line
Only the new line is reported. A naive line-by-line comparison would mark every following line as changed.
ToolHive is a collection of browser tools. + Every tool runs on your own device. Nothing is uploaded to a server.
A reworded line
The line is shown on both sides with the changed words highlighted.
- Nothing is uploaded to a server. + Nothing is uploaded to a server, ever.
Features
- Myers diff — the algorithm behind git diff — so alignment is minimal and correct
- Inline view with both line numbers, and side-by-side view for reading in context
- Word-level highlighting inside replaced lines, so you see the exact words that changed
- Counts of added, removed and unchanged lines
- Swap sides in one click
- Copy the comparison as a +/- diff
- Both panels autosave to this browser
- Bounded work: two wholly unrelated documents fall back to a coarse result instead of hanging
Frequently asked questions
- What algorithm does this use?
- Myers' O((N+M)D) greedy diff, the same algorithm git uses. It finds the shortest edit script, which is why a single insertion is reported as one added line rather than shifting everything below it.
- Can it compare word by word?
- Yes. Inside a replaced block, the side-by-side view highlights exactly which words differ, which is much easier to read than a whole-line change.
- How large a document can it handle?
- Comfortably thousands of lines when the two versions are similar — a 4,000-line document with one changed line diffs in a few milliseconds. If two documents are almost entirely different, the work is capped and the tool reports a wholesale replacement instead of locking up.
- Does it ignore whitespace?
- No. Whitespace differences are real differences, and hiding them would be misleading — a trailing space or a changed indent is exactly the kind of thing people use a diff to find.
- Can I compare JSON with it?
- You can, but JSON Compare is better for that: it compares structure, so reordered keys and different indentation are not reported as changes.
- Is my text uploaded?
- No. The comparison runs in your browser and both drafts are stored only in this browser.
Related tools
About Text Compare
Text Compare is part of Text Tools on ToolHive, a growing collection of small, focused utilities for developers, designers and students. Count, compare, clean and transform text for writing, editing and analysis. Everything runs client-side, so your data never leaves the browser tab — which makes these tools safe to use with work-in-progress code and private content.