テキスト比較ツール
2つのテキストを比較し、並列、統合、またはインラインビューで差分をハイライト。Myersアルゴリズムを使用 — GitやGitHubと同じ。
Original (A)
変更版 (B)
ブラウザで完全に動作する本格的な差分ツール
This page implements the same Myers diff algorithm that Git, GitHub, GitLab, VS Code and most "diff" tools use. It finds the shortest edit script — the smallest sequence of insertions and deletions to turn one text into the other. The result is a clean, intuitive comparison without spurious "everything changed" noise.
3つの表示モード
- 並列 — two aligned columns, like a code review tool. Best for inspecting code diffs at a glance.
- 統合 — git-diff format with
+/−prefixes. Best for sharing patches in chat or documentation. - インライン — changes shown within the flow, with deletions struck through and insertions underlined. Best for prose, blog posts, contracts.
3つの比較粒度
- 行 (default) — the standard for source code and most documents.
- 単語 — best for prose where line breaks are arbitrary. Highlights the actual changed words.
- 文字 — every single character compared. Useful for short strings, IDs, and detecting subtle differences (a Greek letter swapped for a Latin one, a comma changed to a period).
無視オプション
- Whitespace — treat lines/words/characters as equal even if their spacing differs. Essential when comparing code where someone re-formatted.
- Case — case-insensitive comparison. Useful when one source is normalized.
- Empty lines — drop blank lines before comparing. Useful when only paragraph spacing changed.
なぜMyersで単純なアルゴリズムではないのか?
Naive longest-common-subsequence diff is O(N·M) in time and memory — fine for a few hundred lines but slow on real files. Myers' algorithm is O(N·D), where D is the size of the actual diff. For typical inputs (most lines unchanged), D is small and the algorithm runs in near-linear time. Our implementation handles 500-line diffs in milliseconds.
プライバシー
Both texts are diffed entirely in your browser tab. We don't upload, we don't log, we don't analyze. No external library is loaded — the algorithm is ~120 lines of vanilla JavaScript embedded in the page.
エクスポート
The Copy as unified patch button copies a diff -u-style patch
to your clipboard, ready to paste into a GitHub comment, a Slack message, or to save as a
.patch file.
よくある使用例
- 設定ファイルやYAMLマニフェストの2つのバージョンを比較。
- 2つのAI生成ドラフト間の変更を正確に確認。
- 法的契約の改訂を単語ごとに確認。
- 長い文字列(APIキー、ハッシュ、URL)の1文字のタイプミスを発見。
- gitにコミットせずにコード変更の共有可能なパッチを生成。
よくある質問
- この差分チェッカーはどのようにテキストを比較しますか?
- Myersの差分アルゴリズムを使用します — Git、GitHub、VS Codeと同じものです。あるテキストを別のテキストに変換するための最短編集スクリプト(最小の挿入と削除)を見つけ、誤検出のないクリーンな比較を生成します。
- このツールはテキストをサーバーにアップロードしますか?
- いいえ。両方のテキストは約120行のバニラJavaScriptを使用してブラウザタブ内で完全に比較されます。アップロード、ログ記録、外部分析は一切行われません。タブを閉じればデータは消えます。
- どのビューモードと粒度オプションがありますか?
- サイドバイサイド、ユニファイド(git形式)、またはインラインモードで差分を表示できます。比較粒度は行、単語、または文字に設定できます。意味のある変更に集中するために、空白、大文字小文字、空行を無視することもできます。
- 差分チェッカーの一般的な使用例は何ですか?
- 設定ファイルのバージョン比較、法的契約の修正を単語単位で検証、APIキーやURLの1文字のタイプミスの発見、AI生成ドラフト間の変更確認、Gitにコミットせずに共有可能なパッチの生成などに使用されます。
- この差分チェッカーは本当に無料ですか?
- はい、制限なしで100%無料です。サインアップ、ファイルサイズ制限、使用上限、プレミアムティアはありません。必要な回数だけテキストを比較できます。このツールは広告サポートのみです。