About This Tool
What is 文本差异对比?
A tool that compares two texts line by line and visually highlights the differences. Useful for code change reviews, document revision tracking, and translation before/after comparison.
How to Use
- Enter the original text on the left.
- Enter the modified text on the right.
- Click 'Compare'.
- View added lines (green), removed lines (red), and unchanged lines with color coding.
Key Features
- Line-by-line difference comparison
- Color-coded added/removed/unchanged lines
- Intuitive side-by-side split view
- Change statistics (added/removed/unchanged line counts)
Tips
- During code review, paste before and after versions to quickly identify differences.
- When contracts or terms change, compare with previous versions to easily find modifications.
- Line break and whitespace differences are also detected.
文本差异对比
逐行比较两段文本并高亮显示差异
Frequently Asked Questions
文本差异算法如何工作?▼
工具使用逐行差异算法(类似Unix diff)比较原始和修改文本的每一行。识别三种变更类型:添加行、删除行和未更改行。这与Git显示代码更改的方法相同。
可以比较格式化的JSON或代码文件吗?▼
可以。直接粘贴代码或JSON。工具逐行比较,一致的格式能产生更清晰的差异。JSON建议先美化两个版本以便更容易发现结构变化。压缩的代码会显示为一个大的变更。
工具能检测移动或重新排序的行吗?▼
基本差异算法将移动的行视为旧位置的删除和新位置的添加。不会显示'行从X移动到Y'。要检测重排,查找内容相同的绿色(添加)和红色(删除)匹配行。