Monu Tools

文字差異比對

比較兩段文字,並即時在瀏覽器中高亮新增和刪除的行。

如何使用 差異比對

  1. 01

    將原文貼在左側,將修改後的文字貼在右側。

  2. 02

    可選擇忽略大小寫或空白差異。

  3. 03

    查看逐行差異:綠色為新增,紅色為刪除。

What this diff checker does

This text diff checker compares two blocks of text and highlights exactly what changed: which lines were added, which were removed, and the specific words within a changed line. Green marks additions, red marks removals.

Because the comparison runs entirely in your browser, it is fast and private, suitable even for confidential documents and code that you would not want to paste into a server-side service.

The algorithm behind it

It uses a longest-common-subsequence diff, the same core algorithm Git and most code-review tools use, so it reports the smallest, clearest set of changes rather than flagging everything after the first difference.

Ignore case or whitespace

Options let you ignore case or whitespace, which is useful when the only real differences are meaningful ones and you do not want indentation changes or capitalization to clutter the result.

What you can compare

Line-based diffing works equally well for source code, configuration files, logs, JSON, and ordinary prose, so it is handy for comparing two versions of a contract, spotting what changed between two config files, or reviewing an edit to an article.

Paste the original on one side and the changed version on the other, toggle the options you need, and the differences appear immediately.

常見問題

比較是如何運作的?

它使用最長公共子序列差異演算法逐行比較兩段文字,與 Git 使用的方法相同,因此你能得到最小的更改集合。

我的文字會被上傳到任何地方嗎?

不會。比較完全在你的瀏覽器中執行;不會向伺服器傳送任何內容。

它能比較程式碼或設定檔嗎?

能。基於行的差異比對對原始碼、設定檔、日誌和一般文字都很有效。

嵌入此工具

將此工具加入你自己的網站。複製下方的程式碼片段,它會自動保持最新。

<iframe src="https://monu.tools/embed/zh-Hant/diff-checker" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>

相關工具