跳到主要内容

文本对比

UpBox优盒工具箱,免费文本对比工具,按行比较两段文本并标出新增、删除与相同行,支持忽略大小写与空白,本地处理不上传。

无需注册 · 数据不上传No sign-up · nothing uploaded

原始文本Original

对比文本Compare with

差异结果Difference

新增行0
删除行0
相同行0
相似度—
点击“开始对比”后,差异会显示在这里
分别粘贴两段文本后开始对比
本工具所有运算在本地浏览器完成,你的文件、文本不会上传到服务器

工具介绍

文本对比把两段内容按行对齐,逐行标出新增、删除与未改动部分,并给出新增行数、删除行数与相似度。 Text diff aligns two versions line by line and marks added, removed and unchanged lines, alongside added/removed counts and a similarity score.

可忽略大小写、行首尾空白与空行,比较代码、文案或配置时更贴近实际改动;内容在本机处理,不会上传。 Case, leading/trailing spaces and empty lines can be ignored, which suits code, copy or config comparisons. Everything runs locally.

  • 按行对齐比较Line-aligned diff
  • 新增 / 删除 / 相同标记Added, removed, unchanged marks
  • 忽略大小写与空白Case and whitespace tolerance
  • 相似度与行数统计Similarity and counts
  • 本地处理不上传Runs locally

使用说明

  1. 左栏粘贴修改前的内容,右栏粘贴修改后的内容。Paste the original on the left and the new version on the right.
  2. 按需勾选忽略大小写、空白或空行。Tick case, whitespace or empty-line tolerance as needed.
  3. 点“开始对比”,结果按行着色显示。Press Compare to see the coloured line-by-line result.
  4. 用“交换文本”反向核对,或“清空”处理下一组。Swap texts to view the reverse, or clear for the next pair.

常见问题

对比是按行还是按字符?Is the diff line-based or character-based?
按行。适合代码、清单、文案等结构化文本;单行内的字符级差异不会细分。Line-based, which suits code, lists and copy. Character-level changes within a line are not split out.
相似度怎么计算?How is similarity calculated?
用相同行数占两侧总行数的比例(2 × 相同行 / 两边行数之和),只是粗略参考。Unchanged lines over the total on both sides (2 × unchanged / total lines), as a rough indicator.
为什么结果里有一部分没标颜色?Why are some rows uncoloured?
那是未改动的相同行。保留它们便于看清上下文位置。Those are unchanged lines, kept so you can see where changes sit in context.
支持多大的文本?How large can the inputs be?
每侧最多约 1600 行。超过会提示缩短内容,避免浏览器卡顿。Up to about 1600 lines per side; beyond that the page asks you to shorten it to stay responsive.
广告位

此处为广告位,可放置你的推广素材

支持图片、文字或 HTML 代码,替换本区块内容即可投放

浏览其他分类