テキスト
Text Diff
2つのテキストを行単位で比較 — 追加・削除・変更された内容を、変更行内は単語レベルでハイライト表示。
Text Diff compares two texts line by line and shows what was added, removed, or changed, with word-level highlighting inside changed lines — much like git diff, but without a command line.
How to use it
- Paste the original text into one field and the changed version into the other.
- The result immediately highlights added lines, removed lines, and the words that changed within shared lines.
- Handy for scanning large texts — jump straight to the first differences instead of searching manually.
Common uses
- Comparing two versions of a document, article, or config file without installing git.
- Checking exactly what changed in a text after an editor or an automatic formatter touched it.
- Comparing API responses or logs between two runs.
Things to keep in mind
By default a whitespace-only change (like indentation) still counts as a difference, since it technically changes the line's content.
The diff compares lines by position, so adding or removing a single line near the top can shift how the rest of the text lines up.
よくある質問
比較はどのように計算されますか?
比較は行ごとに行われます: 各行は追加、削除、または変更として識別され、変更された行内では正確に異なる単語がハイライトされます。
追加、削除、変更はどのように表示されますか?
追加および削除された行は結果でそのようにフラグ付けされ、変更された行は単語レベルのハイライトを表示し、行全体を読み直さずに何が変わったかをすぐに把握できます。
私の2つのテキストはサーバーに送信されますか?
いいえ、比較はブラウザ内でJavaScriptを使って完全に実行されます — コンテンツはどこにも送信されません。
なぜ1行を挿入しただけで、以降の行がすべて変更として表示されるのですか?
アルゴリズムは、それが挿入なのか大規模な置換なのかを常に正しく判定できるわけではありません — 特に周辺の行が互いに似ている場合はなおさらです。優れたdiffアルゴリズムは最長共通部分列を探すことでこうした誤検出を最小限に抑えようとしますが、常に完璧とは限りません。
比較の際にスペースは考慮されますか?
はい、デフォルトではスペースのみの変更(インデントなど)も差分として扱われます。技術的には行の内容が変わっているためです。