Text Diff - Compare Two Texts Side by Side
About the Text Diff Tool
Comparing two versions of a document, config file, or code snippet by eye is unreliable, especially once the text grows past a few dozen lines. This tool takes two blocks of text and highlights every difference using colour-coded output: lines present only in the second text are shown in green (added), lines present only in the first text are shown in red (removed), and unchanged lines are displayed without highlighting. A stats bar at the top summarises the total number of additions, removals, and unchanged lines so you can gauge the scope of changes at a glance.
How the Diff Algorithm Works
The comparison is performed using a longest common subsequence (LCS)
algorithm. LCS identifies the longest sequence of lines that appear in
both texts in the same order. Any line not part of this shared
subsequence is classified as either added or removed. This line-based
approach is the same foundation used by version control systems like
Git and by the classic Unix diff utility. It gives
accurate, predictable results for plain text of any kind.
Features
- Line-based comparison. Each line is treated as one unit. Added, removed, and unchanged lines are clearly separated in the output.
- Colour-coded output. Green highlights mark lines that were added. Red highlights mark lines that were removed. Unchanged lines appear in their default style.
- Stats bar. A summary at the top shows how many lines were added, removed, and unchanged, giving you a quick overview of the differences.
- Client-side only. The entire diff runs in your browser. No data is sent to any server, and nothing is stored after you close the tab.
Common Use Cases
Developers compare two versions of a configuration file or code snippet to spot unintended changes. Technical writers diff two drafts of a document to review edits. QA engineers compare API responses from staging and production environments. System administrators check differences between server configs across environments. Anyone who needs to answer the question "what changed between these two texts" can paste both versions into this tool and get a clear, visual answer in seconds.
Related Tools
Markdown Preview
Write Markdown and see the rendered HTML output in real time.
Lorem Ipsum Generator
Generate placeholder text in paragraphs, sentences, or words.
List Deduplicator
Remove duplicate lines from a list with options for case sensitivity and sort order.
List Diff / Compare
Compare two lists and find items unique to each, shared between both, or missing from one.