# Text Diff

Canonical URL: https://offlineutils.com/text-diff
Category: Text & Content
Published: 2026-06-24
Publisher: offlineutils.com
Runs entirely in the browser; nothing entered into the tool is uploaded.

> A Text Diff tool aligns two pieces of text and highlights inserted, deleted, and modified lines so you can review differences at a glance — implemented locally in your browser with a longest-common-subsequence diff.

Paste two versions of text into the left and right panes to see a unified diff highlighting changed lines. The algorithm runs in O(N*M) time where N and M are the line counts — fast for files of practical size. Nothing is uploaded; both inputs live only in your tab.

## Features

- Side-by-side panes with line-level diff highlighting
- Inserted, deleted, and modified lines color-coded
- Longest-common-subsequence algorithm — same family Git uses
- Handles files up to several thousand lines per side
- Both inputs stay in your tab — nothing uploaded

## Use cases

- Reviewing what changed between two versions of a config file
- Comparing an expected API response to the actual one
- Spot-checking what an AI rewrite changed in your prose
- Auditing the diff between two prompt versions while iterating

## How to use it

1. **Paste version A** — Paste the original text into the left pane.
2. **Paste version B** — Paste the changed text into the right pane.
3. **Read the diff** — Inserted lines are green, deleted lines are red, modified lines highlight the changed run inline.

## When to use it, and when to use something else

- **vs `git diff` in the terminal** — use Text Diff when the two versions are not in a Git repo — e.g., pasted from chat, email, or two browser tabs. Use `git diff` in the terminal when you are already in a repo.
- **vs diffchecker.com or similar** — use Text Diff when the content is sensitive and cannot be uploaded to a third party. Use diffchecker.com or similar when you want shareable diff URLs.

## Frequently asked questions

### What algorithm does the diff use?

A longest-common-subsequence diff at line granularity — the same family of algorithm Git uses. It produces intuitive diffs and is fast enough for files up to several thousand lines per side.

### Can I diff JSON or code?

Yes — paste either side as JSON, JavaScript, or any text. For best results with JSON, format both sides first using the JSON Formatter so line breaks line up.

### Does this work for binary files?

No. Diff tools operate on text. Drop a binary file and you'll see meaningless byte-level output.

## Related tools

- https://offlineutils.com/json-formatter
- https://offlineutils.com/case-converter
- https://offlineutils.com/list-deduplicator
