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.
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.
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.
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.
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%.
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.
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.
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.
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: 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