Skip to content
100% in your browser. Nothing you paste is uploaded — all processing runs locally. Read more →

Text Diff Viewer

Paste two texts. See exactly what changed — line by line in side-by-side view, or unified-diff format you can copy into a patch file. Word-level highlighting on changed lines so you spot the actual edit, not the noise around it.

+0 −0 =0

What this tool does

Common use cases

Why client-side

Comparing two texts is a great example of "obvious to upload, no reason to." The data you'd be sending — emails, internal docs, proprietary code — is often the most sensitive thing on the page. The math is small enough that running it in your browser costs you nothing.

This tool ships about 4 KB of JS for the full diff engine plus word-level highlighting. The LCS algorithm is the same one Git used in its early versions; modern Git uses Myers, which is faster on large inputs but produces near-identical results on typical inputs.

Limitations

Related tools

FAQ

Is anything I paste sent to a server?

No. Both inputs and the diff calculation run in your browser — open DevTools → Network and confirm. Your code never leaves your device.

What algorithm does this use?

Longest Common Subsequence (LCS) with backtracking — O(N×M) time and memory. For typical inputs (tens to hundreds of lines per side) this is instant. For very large inputs (thousands of lines), Myers' O((N+M)·D) algorithm is faster; we'll add it if the LCS approach hits a wall in practice.

What's the difference between side-by-side and unified view?

Side-by-side shows the two texts in parallel columns with deletions on the left, insertions on the right, and changed lines paired with word-level highlighting. Best for code review and visual comparison. Unified shows one column with - lines for deletions, + for insertions, and unchanged lines in between — the format Git emits and the one most diff/patch tools accept as input.

What's 'ignore whitespace' actually doing?

When checked, the diff comparison normalises both inputs by stripping all whitespace before computing the LCS. Lines that only differ in indentation, trailing spaces, or line endings (LF vs CRLF) are reported as equal. The displayed text still preserves the original whitespace; only the comparison is whitespace-insensitive.

Can I diff JSON / YAML structurally instead of textually?

Not yet — this tool is line-based. For JSON, format both inputs first with json.tooljo.com (sorted keys, consistent indent) and then diff. That gets you most of the way to a structural diff without needing schema-aware comparison.

How does word-level highlighting work?

Within paired changed lines (lines that were 'replaced'), the tool runs a second LCS pass at word granularity to highlight only the bytes that actually changed. So in The quick brown fox → The QUICK brown fox, only quick → QUICK is highlighted, not the entire line.