⚖️

Text Compare

Line-by-line LCS diff of two text files with added, removed and equal stats.
Compare 📂 File 👤 ToolWorld 🏷️ v1.1.12
Loading...

Text Compare

Line-by-line diff of two files

Original A
📄 Drop or click to load the original file
vs
Modified B
📝 Drop or click to load the modified file
Equal {n} Added {n} Removed {n}
Original A Modified B

How to Use

📖 Tool Introduction


Text Compare is a completely free, browser-local tool that computes the differences between two text files. It takes two files as input and uses the classic longest-common-subsequence dynamic programming algorithm to align them line by line, then renders the original and modified file side by side. Grey lines are identical on both sides, red lines exist only in the original (they were removed), and green lines are newly added in the modified file, each annotated with its line number for quick navigation. A stats strip at the top summarizes the counts of equal, added and removed lines, so you can judge the scale of a change at a glance. Programmers use it to compare two versions of source code and configuration, editors use it to review drafts before and after revision, and operators use it to check differences between logs and reports. The tool can copy a unified diff text or download a .diff file, ready to paste into version control systems or keep as an archive. All computation happens locally, so no file ever reaches a server, which makes it safe even for confidential content. The interface ships in Simplified Chinese, Traditional Chinese and English, follows the site theme automatically, and works smoothly on both desktop and mobile devices. A built-in example loads two release-note drafts in one click, so you can explore the whole diff workflow in seconds without preparing your own files. Because there is no upload, the tool also works offline and on locked-down networks, and it never blocks on slow connections. Whether you compare a ten-line config or a two-thousand-line document, the side-by-side layout keeps every change traceable and reviewable. Because the diff is computed purely in memory, there is no waiting for a server round trip, and the tool remains responsive even when you swap files back and forth while tuning a patch. The exported unified diff follows the conventional minus-plus convention, so pasting it into a code review thread or a changelog reads naturally to teammates. A built-in example loads two release-note drafts in one click, which lets first-time users explore the whole comparison flow without preparing their own files. Everything stays on your device, which makes the tool equally suitable for open-source review and for internal documents that must never leave the office network.

✨ Key Features


  • LCS line diff: longest-common-subsequence algorithm for natural, accurate alignment
  • Side-by-side view: original and modified files shown in two aligned columns
  • Three-color highlight: equal lines grey, removed lines red, added lines green
  • Diff stats: live counts of equal, added and removed lines
  • Unified diff export: copy or download a standard unified diff text
  • Pure local: files never leave the browser, keeping sensitive data safe

📝 How to Use


  1. Drop the original file into the left dashed box, or click to choose it
  2. Drop the modified file into the right dashed box, or click to choose it
  3. Once both sides show a filename and line count, click Compare
  4. Inspect the highlighted differences in the side-by-side view below
  5. Click Copy diff or Download .diff to export the result for archives

⚠️ Notes


  • Two files needed: loading only one file triggers a friendly reminder
  • Line limit: files over about 2000 lines should be trimmed for smooth rendering
  • File size: each file is capped near 20MB; compare excerpts for larger files
  • Encoding: files are read as UTF-8, other encodings may show garbled text
  • Non-destructive: comparison never edits the originals, re-run it freely

Related

⏫︎