Text Diff Tool Online — Word, Char, Line Level
Compare 2 texts với highlight + / − added/removed. 3 mode: word-level (default, đọc dễ), char-level (precise), line-level (cho code). Stats added/removed/unchanged.
The quickfast brown fox jumpsleaped over thea lazy dog.!
Vì sao dùng tool này
Word: diff theo từ, dễ đọc. Char: diff theo ký tự, precise. Line: diff theo dòng, cho code.
Số ký tự / từ / dòng added (xanh), removed (đỏ), unchanged. Quick overview change scale.
Edit text bên nào cũng update diff ngay. Không cần bấm button.
Cách sử dụng
- 1Paste Text A (original) bên trái, Text B (modified) bên phải.
- 2Chọn mode: word (default) / char / line.
- 3Diff highlight: xanh = added, đỏ + strike = removed, xám = unchanged.
Text diff
Diff algorithm dùng Myers diff (E. Myers, 1986) — O(ND) complexity, tối ưu cho text. Lib jsdiff implement.
Word-level: split by whitespace + punctuation. Char-level: per character. Line-level: per \n.
- ✓3 levels: word / char / line
- ✓Highlight + / − inline
- ✓Stats added / removed / unchanged
- ✓Realtime update
- ✓Pure client-side
- ✓Myers diff algorithm
Câu hỏi thường gặp
Khác git diff?
Git diff line-level + Patience/Histogram algorithms. Tool dùng Myers — đủ cho daily compare. Cho code review chính thức dùng git.
Diff text >100KB chậm?
Có. Diff O(ND) — long input + many changes → exponential. Cho text >50KB recommend split.