比较两段文本,并即时在浏览器中高亮新增和删除的行。
如何使用 差异对比
将原文粘贴在左侧,将修改后的文本粘贴在右侧。
可选择忽略大小写或空白差异。
查看逐行差异:绿色为新增,红色为删除。
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.
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.
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.
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/diff-checker" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>相关工具