比较两个大文本文件,不上传
在浏览器里比较各 10 MB 的两个文本文件,输出统一格式 .diff 或自包含的并排 HTML 页。
每个文件不超过 10 MB,且只接受文本;全程不上传。
在本标签页内运行,不上传任何内容。
结果
免费档:每文件最多 10 MB,每次 2 个文件,每天 5 次。这件工具单件买断 $35,一次付款。对比价格。
授权:免费档。
这页与别处不同之处
在线 diff 往往意味着把文件贴到别人的服务器,而合同草稿、事故日志和导出的配置恰恰不能这么做。这个页面在本地读取两个文件并逐行比较:先剥掉相同的首尾,再用只出现一次的行做锚点,按所选上下文报告改动。它写出可交给 patch 的统一 diff,或给不读 diff 的同事看的并排 HTML。
完全在标签页里比较两个十兆字节文件,同时产出统一 diff 与自包含并排页。
示例输入与输出
| 环节 | 情形 | 体积 | 说明 |
|---|---|---|---|
| 输入 | Two versions of a config export | 219 B | two small YAML exports with one changed value and one toggled flag |
| 输出 | A unified diff | 230 B | one hunk with three lines of context, plus a closing count of added and removed lines |
这里写的是本页构建时对照的演示数字,不是对每个文件的承诺。
你可以自己核对什么
| 承诺 | 测试结果 |
|---|---|
| a single changed line in a 400-line file is one hunk, not a wall of output | unit test changes line 200, asserts 199 unchanged lines are stripped from each end and exactly one hunk is produced |
| the side-by-side page references nothing outside itself | test asserts the output starts with a doctype, contains line-number cells and no http or https reference |
| ignoring whitespace is a choice with three different answers | test shows a trailing-space change as a difference under exact mode, ignored under trim, and inner spacing ignored under all |
常见问题
以下问答目前仍为英文原文。
Why not use git or my editor?
Use them when the files are in a repository or on the same machine. This page is for the three cases they do not cover: a file you are contractually not allowed to upload, a one-off export that is not in any repository, and a comparison a non-technical colleague has to read, where a side-by-side HTML page beats a terminal.
What does each whitespace option actually ignore?
Exact compares every character, so a trailing space is a difference. Trim ignores leading and trailing whitespace, which makes a re-indented block look unchanged. All ignores whitespace inside the line too, so "foo bar" and "foobar" count as the same line; that is useful for tokenised dumps and dangerous for prose, so it is not the default.
What happens when the two files are identical?
The page says so instead of downloading an empty file. An empty diff looks like a failed run, and the line count gives you something to quote when the answer is "nothing changed".
How large a comparison is realistic?
Ten megabytes per file, and the page aborts with a clear message if the files differ in more than two hundred thousand lines. In practice the shared beginning and end are stripped first and the rest is anchored on unique lines, so a log with a handful of changed entries stays fast even when it is large.
Does it handle Word documents or PDFs?
No. Those are archives or page descriptions, not text, and a line diff of their bytes is noise. Convert to plain text first. The page also does not merge three versions or compare syntax trees; it compares lines, exactly and predictably.
价格
这件工具一次性 $35,只要工具还在就一直可用。一次付款,不是订阅。授权存在当前浏览器里,凭交易号可在别处恢复。
免费档:每次 2 个文件,每文件 10 MB,每天 5 次。买断:50 个文件,每文件 200 MB。