TT Text Tools

Text Diff

Compare two texts or files by lines, words, characters or sentences, inline or side by side, and export a .patch — all locally in your browser.

🔒 Runs entirely in your browser — nothing is uploaded

Drop a file or click to browse
Drop a file or click to browse

Was this tool useful? Rate it:

Compare two versions of text locally

A visual diff makes changes easier to review than reading two drafts side by side. This tool compares an original text with a changed version and highlights what was removed and what was added. It is useful for release notes, policy edits, support macros, code snippets, translated strings, copied configuration and any situation where you need to understand what changed before accepting or sharing the new version. You can paste text or drop files such as .txt, .md, .json, .csv or source code onto either box. The comparison is generated entirely in the browser.

Four comparison modes cover different kinds of review. Line mode is best when structure matters: lists, logs, markdown and code are easier to scan when whole changed lines are colored. Word mode suits prose because it shows smaller edits inside a sentence, character mode catches single-letter typos and changed IDs, and sentence mode shows which sentences were rewritten. Options to ignore whitespace, letter case and blank lines hide noise such as re-indented code or extra empty lines, so only meaningful edits remain.

Reading the diff output

Removed text is shown with a red background, and added text is shown with a green background. The side-by-side view puts the original and the changed version in two columns with line numbers, and changed lines that face each other get a stronger highlight on the exact words or characters that differ. The inline view shows a single stream, with line numbers in line mode. Use Next and Previous, or F7 and Shift+F7, to jump from one change to the next instead of scrolling through long documents. The summary shows the number of changes, how much was added and removed, and a similarity percentage.

Review and share changes

Compare a revised email template against the approved copy, check whether a generated answer changed important wording, inspect a configuration snippet before applying it, or verify that a list cleanup only removed intended entries. When you need to hand the changes to someone else, download a unified .patch file: it uses the same format as git and can be applied with git apply or patch -p1. A diff is not a substitute for judgment, but it reduces the chance of missing small changes. Keeping the operation local also avoids creating a server-side copy of drafts that may still be confidential.

Like the rest of Text Tools, this page is designed for quick, repeatable utility work rather than account-based storage. Keep the original text nearby when the output matters, review the result, and copy only the final version you want to use.

How to use

  1. Add both versionsPaste the original text on the left and the changed text on the right, or drop a file onto each box. Dropping two files at once fills both sides.
  2. Pick mode, view and optionsCompare by lines, words, characters or sentences, choose inline or side-by-side view, and optionally ignore whitespace, case or blank lines.
  3. Review the changesClick compare, then use Next and Previous (or F7 and Shift+F7) to jump between changes while checking the similarity score.
  4. Export a patchDownload a unified .patch file of the exact changes to share or apply with git apply or patch.

Frequently asked questions

Is my text sent to a diff server?
No. The diff is generated in your browser with the JavaScript diff library, and dropped files are read locally.
Which comparison mode should I use?
Use lines for code, lists and documents, words for prose, characters for typos, IDs and short strings, and sentences when whole sentences were rewritten or reordered.
What do the ignore options do?
Ignore whitespace treats spacing and indentation differences as equal, ignore case treats upper and lower case as the same, and ignore blank lines leaves empty lines out of the comparison.
How is the similarity percentage calculated?
It is twice the number of matching characters divided by the combined length of both texts, so identical texts score 100% and completely different texts score 0%.
Does the .patch file respect the ignore options?
No. The patch always records the exact differences so it can be applied cleanly with git apply or patch -p1.
Can it compare confidential drafts?
Yes, because comparison is client-side. Still avoid pasting secrets into any browser page you do not trust.