Text Diff
Text Tools

Text Diff

0 lines
0 lines

Paste text in both panels and click Compare

Text Tools

Text Diff Tool — Compare Two Texts Online, Instantly

The text diff tool on say.tools lets you compare two texts side by side in seconds. Whether you're reviewing document edits, checking code changes without Git, or verifying content revisions, this online diff checker makes it effortless to find every difference between two versions of any text.

How to Use the Text Comparison Tool

Using the text compare tool is straightforward: paste your original content in the left panel and your modified version in the right. Select either Line diff or Word diff mode, then click Compare. The results appear immediately below — lines added appear with a green highlight, and removed lines are shown in red. Unchanged lines appear in a neutral style, making it easy to scan through context.

Line Diff vs Word Diff

The tool supports two comparison modes to suit different workflows. Line diff is the classic mode — it compares texts line by line, ideal for code, configuration files, and structured documents. Word diff goes deeper, analyzing changes at the individual word level within each line. This is perfect for prose editing, where you want to see exactly which words were substituted, deleted, or inserted without losing sight of the surrounding sentence structure.

The Myers Diff Algorithm

Under the hood, this diff checker uses a variant of the Myers diff algorithm — the same algorithm powering git diff. It computes the Longest Common Subsequence (LCS) between the two texts to find the minimal edit script, meaning it produces the smallest number of additions and deletions needed to transform one text into another. This ensures the diff output is both accurate and easy to read.

Reading the Unified Diff Output

The output follows a unified diff format with line numbers for easy reference. Each line is prefixed with a symbol indicating its status: a + for added content and a for removed content. Unchanged lines are shown without a prefix and appear in the default text colour. The stats bar at the top summarizes the total number of additions, removals, and unchanged lines at a glance.

Use Cases for Text Diff

Text diff tools are used across a wide range of professional contexts. Writers use them to track editorial revisions between drafts. Developers compare configuration files, database schemas, or log outputs. Content managers verify that CMS exports match expected outputs. Legal professionals compare contract revisions to identify clause changes. Translators compare source text updates to determine what sections need re-translation. This diff checker handles all of these scenarios without any sign-up, upload, or data leaving your browser.

100% Private — No Data Sent to Any Server

Unlike many online diff tools, this text comparison tool is entirely client-side. Your text never leaves your device. The diff algorithm runs in your browser using vanilla JavaScript, so you can safely compare sensitive documents, private correspondence, or proprietary code without any privacy concerns. No account required, no file size limits, no ads — just a clean, fast diff tool that works every time.

FAQ

What is a text diff tool?

A text diff tool compares two pieces of text and highlights the differences — showing which lines or words were added, removed, or unchanged. It's essential for reviewing document changes, code revisions, and content edits.

How does the diff algorithm work?

The Myers diff algorithm finds the Longest Common Subsequence (LCS) between two texts. It identifies matching sections, then marks everything not in the LCS as either added or removed. This produces the minimal edit distance between the two texts.

What is unified diff format?

Unified diff format uses +/− prefixes to mark added and removed lines. It's the standard format used by Git and most version control systems. Context lines (unchanged) are shown without a prefix for readability.

How do I compare two versions of a document?

Paste the original document in the left panel and the revised version in the right panel. Choose line or word diff mode, then click Compare. Additions appear green, removals in red, and the stats bar shows a quick summary of all changes.

Copied to clipboard!
Home