⇆ Text Diff Checker

Compare two texts side-by-side with line, word, and character-level highlighting. Free online text diff tool with similarity score, ignore-whitespace, and unified-diff export.

What is Text Diff Checker?

A real-time text diff and compare tool that highlights every change between two versions of a document. Choose side-by-side or unified GitHub-style view, switch between line, word, and character granularity, and toggle ignore-whitespace and ignore-case to see the differences that actually matter. The tool computes additions, removals, unchanged lines, word and character deltas, and an LCS-based similarity percentage. Built for writers reviewing edits, lawyers comparing contract revisions, developers checking config drift, and anyone who needs to know exactly what changed between two pieces of text. Runs entirely in your browser — paste sensitive contracts and code snippets without anything ever leaving your device.

How to Use

  1. Paste your original text on the left and the changed text on the right (or use the sample button to see it in action).
  2. The diff highlights every change instantly — green for additions, red for removals, plain for unchanged.
  3. Switch between Side-by-side and Unified views; toggle Line, Word, or Character granularity.
  4. Turn on "Ignore whitespace" or "Ignore case" if those differences are noise rather than signal.
  5. Read the stats panel for added/removed counts and the overall similarity percentage.
  6. Export the diff as plain .txt or as a .patch file in unified diff format.

How the diff algorithm works

Under the hood the tool uses the Longest Common Subsequence (LCS) algorithm — a classic dynamic-programming approach that finds the longest sequence of elements common to both inputs in their original order. Once the LCS is known, the algorithm walks both texts and labels each element as equal (in the LCS), removed (in the original only), or added (in the changed text only). Line diff runs LCS over arrays of lines; word diff runs the same algorithm again on the words inside each pair of changed lines; character diff drills further into the words. The whole computation is O(n × m) and runs in milliseconds for documents up to several thousand lines.

When ignore-whitespace and ignore-case actually help

Reformatted code or rewrapped paragraphs often produce visually overwhelming diffs that obscure the real changes. Ignore-whitespace collapses all runs of spaces, tabs, and newlines to a single space before diffing, so a paragraph that was simply rewrapped to a different column width comes out as 100% similar. Ignore-case is most useful for comparing case-insensitive identifiers (SQL keywords, HTML tags, environment variable names) where casing changes are stylistic rather than meaningful. Use them as filters to surface logic changes hidden behind formatting noise — but turn them off again before signing off on a final review, since they can mask real edits.

Practical use cases

  • Editorial review — paste original copy and editor's revision, see every word change in seconds.
  • Contract redlining — compare two contract drafts to confirm a counterparty changed only the clauses they said they would.
  • Config drift detection — diff your local config against the version on staging to spot accidental changes.
  • Translation verification — compare translation memories against new source text to find what needs re-translating.
  • Legal due diligence — compare two versions of NDAs, terms of service, or privacy policies side by side.

Frequently Asked Questions

How is the similarity percentage calculated?

It uses the Longest Common Subsequence (LCS) algorithm — the same approach Git uses internally. The score is the LCS length divided by the longer of the two texts, expressed as a percentage. 100% means identical, 0% means no characters in common in their original order. A typical light edit lands in the 90-99% range; a major rewrite is below 50%.

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

Line-level treats each line as atomic — useful for code or structured documents where changes happen line-by-line. Word-level highlights specific words that changed within a line, ideal for editing prose. Character-level zooms in further to show exactly which characters were added or removed inside a word — handy for spotting typos and accidental edits in identifiers.

Will this work for code, config files, and JSON?

Yes — the tool is format-agnostic. It treats input as plain text and detects line breaks, words, and characters generically. For code review, switch to Line + Word granularity and consider turning on "ignore whitespace" so reformatting noise does not mask logic changes. For JSON or YAML, format both sides identically first (using a formatter tool) so structural changes show up cleanly.

Is my text uploaded anywhere?

No. The diff is computed locally in your browser using JavaScript. No text is ever sent to a server, logged, or stored. You can paste contracts, source code, NDAs, or sensitive drafts and clear the page when you are done.

What is unified diff (.patch) format?

Unified diff is the standard format used by Git, version control systems, and code review tools. Removed lines start with "-", added lines with "+", unchanged with a space, and context blocks are marked with "@@". Most code review platforms (GitHub, GitLab, Bitbucket, Gerrit) accept .patch files for applying changes via "git apply" or "patch -p1".

Related Tools

  • 🔁 Find & Replace (Regex) — Powerful browser-based find-and-replace with regex support, multiple sequential rules, live preview, and 10+ p
  • 📝 Word Counter — Count words, characters, sentences, and paragraphs instantly as you type. Free online word counter with readin
  • 🧹 Whitespace & Text Cleaner — Strip extra spaces, tabs, blank lines, invisible Unicode characters, smart quotes, and other text gunk introdu
  • 💘 Secret Crush Detector — Party game: everyone secretly picks a crush with a PIN-protected pick, then reveal mutual matches. 100% privat
  • 🎲 Truth or Dare Generator (Smart Mode) — The smartest Truth or Dare generator online. 200+ prompts across 5 group types (friends/couples/office/family/
  • 🤖 ChatGPT Humanizer — De-robotize AI text in your browser. 200+ AI-tell swaps, contraction injection, em-dash cleanup, sentence-vari
  • Aa Case Converter — Convert text between UPPERCASE, lowercase, Title Case, camelCase, snake_case, kebab-case, and more.
  • ¶ Lorem Ipsum Generator — Generate placeholder text in paragraphs, sentences, or words. Perfect for mockups and design work.

Related: text diff, text compare, diff checker, compare text, text comparison tool, text diff online, compare two texts, find differences in text, text comparison, word diff, line diff, character diff, unified diff, side by side diff, compare documents online, free diff tool, similarity checker, lcs diff