ToolConvoyToolConvoyv2.6
TEXT

Text Diff — Compare Two Texts Line by Line

Compare two texts and see differences highlighted. Line-by-line diff with added, removed, and unchanged lines — all processing runs in your browser.

● LOCAL · CLIPBOARD-FRIENDLY0 network requests from tools since page load

A text diff is the output of the longest-standing developer tool that has never changed in principle. The diff command was written by Douglas McIlroy and James Hunt in the early 1970s for Unix, and every version-control system since — RCS, CVS, Subversion, Git — has built its core comparison engine on the same algorithm: finding the longest common subsequence of two sequences of lines, and reporting the lines that are not part of that subsequence as additions or deletions. The Text Diff tool implements the same algorithm in the browser, with the same output format that every developer recognises: a unified diff with colour-coded lines.

The most common use case is comparing two versions of a file — a config file before and after a change, a log snippet from two different runs, a paragraph rewritten for clarity. The line-based diff is the right default for most text; the word-based diff is the right pick for long unwrapped lines where the change is a single word or value and the line-based diff would flag the entire line as modified. The ignore-whitespace toggle is the right pick for code where a reformatter changed indentation but not logic. The output, whether copied as unified diff text or read visually in the colour-coded view, is the same diagnostic that has driven code review for fifty years.

Advertisement

How to use

  1. Paste the original and modified text

    Paste the two versions into the left and right panels. The diff updates as you type — each line is compared and colour-coded as added, removed, or unchanged. Use the swap button to flip the panels if you pasted them in reverse.

  2. Choose a diff algorithm

    Select between line-based (fast, good for prose and config files) and word-based (slower, better for long lines like minified JSON or URL query strings). The word diff highlights the exact changed words within a modified line.

  3. Copy or export the diff

    Copy the unified diff format for pasting into a git commit, a code review, or a ticket. The visual diff is colour-coded and screen-reader-accessible with ARIA annotations.

Frequently asked

What is a unified diff?

The unified diff format is the standard format produced by `diff -u` and `git diff`. It shows a few context lines around each change, with lines prefixed by `+` (added), `-` (removed), or space (unchanged), and a header line indicating the file names and line offsets.

Does it ignore whitespace changes?

Yes — toggle 'ignore whitespace' to treat lines that differ only in indentation or trailing spaces as identical. Toggle 'ignore blank lines' to skip lines that are empty in both versions. Both options are useful for comparing formatted code where whitespace changes are noise.

Can it compare more than two versions?

No. The tool compares exactly two texts. For three-way merge comparison (common ancestor, version A, version B), use `git merge-file` or a dedicated merge tool. The two-way diff is sufficient for the most common cases: before/after, original/proposal, production/staging.

How large can the texts be?

The tool is limited by browser memory — typically tens of megabytes for each input. For files larger than 10 MB, expect slower diff computation. The line-based algorithm is O(N*D) where N is the total line count and D is the number of differences.

Limitations

  • No merge capabilityThe tool shows differences but cannot produce a merged output. For merging two diverged versions of a file, use `git merge` or a three-way merge tool. The diff is the diagnostic; the merge is the operation.
  • No binary diffText content only. Binary files (images, PDFs, compiled code) cannot be compared meaningfully with a line-based diff. Use `cmp`, `xxd`, or a hex-diff tool for binary comparison.
  • No syntax-aware diffThe diff is purely text-level. It does not understand programming language syntax and may pair lines incorrectly in heavily refactored code. Syntax-aware diffs (used by some IDEs) produce semantically better results for code but are significantly slower.

Platform notes

macOS
The macOS terminal equivalent is `diff -u file1.txt file2.txt`. The `opendiff` command (FileMerge from Xcode) provides a GUI for file and directory comparison with merge support.
Linux
`diff`, `vimdiff`, and `meld` are the standard tools. The browser tool is convenient for comparing text from clipboard without creating temp files — paste directly and the diff is instant.
Web
Runs entirely in the browser. No text content is sent to a server — useful for comparing proprietary source code, internal documents, and configuration files with secrets.
Advertisement
Advertisement