Logo

MonoCalc

/

Text Diff Checker

Text
0 lines0 words0 chars0 BNone
0 lines0 words0 chars0 BNone

Granularity:

View:

Ignore case

Ignore whitespace

Trim line ends

Ignore blank lines

Ignore punctuation

Normalize line endings

Sort lines first

Unchanged lines kept around each change
Decimals in the similarity percentage
What counts as a word in word mode

Line numbers

Only changes

Show whitespace

Colourblind palette

Enter text in both panes to compare
Paste an original and a modified version, or load one of the sample pairs above. Everything is compared inside your browser — no text is uploaded.

About This Tool

Text Diff Checker – Compare Two Texts and See Exactly What Changed

A text diff checker takes an original and a revised version of the same content and shows you precisely what moved between them: which lines were added, which were deleted, and which were rewritten in place. Reading two drafts side by side and hunting for the delta by eye is slow and unreliable — a diff makes the change explicit, down to a single character if you need it. This tool runs entirely in your browser, so drafts, configuration files, API payloads, and log excerpts never leave your device.

How the comparison works

The engine implements Myers' difference algorithm, the same shortest-edit-script approach used by git diff. It finds the smallest set of insertions and deletions that turns the original into the modified version, then pairs adjacent deletions and insertions so both panes stay aligned row for row. On top of that edit script the tool computes the Levenshtein edit distance — the minimum number of single-character insertions, deletions, or substitutions needed to convert one text into the other — and derives a similarity score:

similarity = (1 − distance ÷ max(lengthA, lengthB)) × 100

Two identical texts score 100%. Two texts with nothing in common approach 0%. Because the distance matrix costs O(m × n), the exact value is computed only below roughly 10,000 characters per pane; above that a line-level estimate is shown instead so the page never freezes.

Line, word, and character granularity

Line mode is the classic diff and the right default for code, YAML, .env files, SQL, and logs — anything where a line is the natural unit of change. Word mode compares individual words, which is what copy editors and translators want: a single reworded phrase inside a long paragraph is highlighted in place instead of flagging the whole sentence. Character mode is the finest setting and exists for the cases that matter most and are hardest to spot — a transposed digit in an order ID, a wrong character in a hash, a mistyped version string like ORDER-2024-A1938 versus ORDER-2024-A1983.

Normalization rules filter out noise

Most "differences" between two files are cosmetic. The ignore rules normalize both texts before the comparison runs, in a fixed order: line endings first, then per-line trimming, whitespace collapsing, blank-line removal, punctuation stripping, case folding, and finally optional line sorting for when order does not matter. If the two texts turn out to match only because of the rules you enabled, the result says so and lists exactly which rules were responsible — you never get a silent false match.

Mixed line endings are the classic false positive
A file saved on Windows (CRLF) compared against the same file saved on Linux (LF) can show every single line as changed. The line-ending badge above each pane tells you what you are dealing with, and normalizing endings makes the real edits visible again.

Unified patch output

Switching to the unified view produces standard Git-style patch text with @@ hunk headers, + and - prefixes, and a configurable number of context lines. The output is copy-paste-ready for a code review comment, or downloadable as a .diff file. The same change list also exports as CSV — one row per change with line numbers and before/after values — or as a Markdown table.

Reading the statistics

Beyond the visual diff, the statistics panel reports lines added, removed, modified, and unchanged, word and character deltas, and the number of change blocks (hunks) — contiguous regions that differ. A high similarity score with many hunks means lots of small scattered edits; a lower score with one hunk usually means a single large rewrite. Each pane also reports its own line, word, character, and UTF-8 byte counts, which is worth remembering: multibyte characters make byte size larger than character count.

Practical uses

Writers compare two drafts of an article or email. Developers diff two versions of a config file outside of version control. QA engineers compare two API responses or log excerpts to isolate a regression. Students check what a reviewer changed. Localizers verify that only the intended strings moved after a batch update. And anyone can confirm that a find-and-replace or an automated transformation did exactly what it promised — nothing more.

Privacy by design
Every comparison is performed locally with JavaScript. No text is uploaded, stored on a server, or logged, which is why this tool is safe for confidential drafts and internal configuration.

Tips for a cleaner diff

Turn on Only changes to collapse long unchanged regions behind expandable separators when comparing large documents. Use Show whitespace when a line looks identical but still reports as changed — an invisible tab or trailing space is usually the culprit. Use Format JSON before diffing API payloads so formatting differences disappear and only real value changes remain. And if red and green are hard to distinguish, the colourblind-safe palette switches the highlighting to blue and orange while keeping the +, -, and ~ markers and screen-reader labels intact.

Frequently Asked Questions

Is the Text Diff Checker free?

Yes, Text Diff Checker is totally free :)

Can I use the Text Diff Checker offline?

Yes, you can install the webapp as PWA.

Is it safe to use Text Diff Checker?

Yes, any data related to Text Diff Checker only stored in your browser (if storage required). You can simply clear browser cache to clear all the stored data. We do not store any data on server.

How does the Text Diff Checker work?

It runs Myers' difference algorithm — the same algorithm Git uses — over your two texts to find the shortest set of insertions and deletions that turns the original into the modified version. Those edits are then rendered as colour-coded rows, a token stream, and a unified patch, all computed inside your browser.

What is the difference between line, word, and character mode?

Line mode compares whole lines and is best for config files, code, and logs. Word mode compares individual words, which suits prose and copy-editing where one changed word inside a paragraph matters. Character mode is the finest and catches single-digit changes in IDs, hashes, and version strings.

What do the ignore rules actually change?

They normalise both texts before the comparison runs, in a fixed order: line endings, trimming, whitespace collapsing, blank lines, punctuation, case, then optional line sorting. If the texts match only because of those rules, the tool says so explicitly and lists which rules were responsible.

How are similarity and edit distance calculated?

Edit distance is the Levenshtein distance — the fewest single-character insertions, deletions, or substitutions needed to convert one text into the other. Similarity is (1 − distance ÷ longest length) × 100. Above 10,000 characters per pane the exact matrix is skipped for speed and a line-level estimate is shown instead.

Is my text uploaded anywhere?

No. The entire comparison runs locally in your browser using JavaScript, so nothing is sent to a server. That matters because diffed content is often confidential — drafts, credentials-adjacent config, log excerpts, or unreleased copy.

Can I export the result as a patch file?

Yes. The unified view produces standard @@ hunk output with a configurable number of context lines, which you can copy or download as a .diff file. You can also export the change list as CSV or Markdown for review comments and spreadsheets.