LocalExcelTool
はじめる

テキスト比較(ビュー)

2 つのテキストを左右に並べて行単位で比較。削除行は赤、追加行は緑でハイライト。

テキスト比較(ビュー)とは

テキスト比較ツールは、2 つのテキストを左右に並べて行単位で比較し、削除行を赤・追加行を緑で表示します。行番号付きなので「何行目が変わったか」がすぐ分かります。空白の違いを無視するオプションと大文字小文字を無視するオプションがあり、句読点だけの違いを実質同じ行として扱えます。統一 diff ビューに切り替えると、- / + 記法の結果をそのままコピーできます。最長共通部分列(LCS)で最小の変更として提示し、各 3000 行まで、処理はブラウザ内で完結します。

このツールの前提

処理場所
このページのブラウザ内(JavaScript / Canvas)
アップロード
なし — ファイルは端末の外に出ません
オフライン
ページを開いた後は通信不要

Why the diff walks lines, not characters

The comparison is a longest-common-subsequence over whole lines, which is the same class of algorithm git uses. Its useful property is minimality with meaning: when you insert one paragraph, the result shows one green block — not a cascade of half-matched lines that technically differ but read as noise. Character-level diffing would be more precise on a single edited sentence, but on real documents it produces sub-line highlights that are harder to act on than the honest answer of "these three lines changed".

That is also why very large inputs are capped at 3,000 lines per side. The dynamic-programming table grows with the product of the two line counts — 3,000 by 3,000 is nine million cells, which is where the browser's budget realistically ends. Past the cap you get an error naming the counts, not a frozen tab and not a silently truncated comparison that pretends the tail did not exist.

What the two ignore options actually change

Whitespace folding collapses runs of spaces and tabs and trims the ends, so a line that was only re-indented compares as unchanged. This is the right default for prose pasted out of mail clients or exported from spreadsheets, where indentation carries no meaning — and the wrong one for Python or YAML, where indentation is the program. Case folding treats Letter and letter as the same line; useful when comparing a log against a report that normalized capitalization, misleading when comparing constants against strings.

Both options affect only what counts as identical. When a line matches under the relaxed rules, the panes still show each side's original text untouched — the option never rewrites what you see, only whether it is colored. That separation matters: a diff that quietly normalizes what it displays makes you unable to spot the difference that actually bit you, which is the one thing a comparison tool must never do.

Side by side or unified — and when each one wins

The default view puts the two texts in aligned panes with independent line numbers, so a changed line sits at the same height on both sides and your eye does not have to jump. Removed lines leave the right pane blank and added lines leave the left blank — the blank is information, telling you which side the line belongs to without reading a legend.

The unified view is the classic minus-plus stream. It exists because sometimes the deliverable is not "what changed" but the change itself: a unified diff pastes cleanly into a code review, a commit message, or a ticket. If you find yourself copying from the side-by-side view line by line, switch to unified first — the output is the same information in the exact shape that downstream tools expect. Both views render the same underlying diff, so switching never changes the result.

使い方

  1. 1.元テキストを左に貼り付け
  2. 2.変更後テキストを右に貼り付け
  3. 3.比較してハイライトを確認

他の方法との比較

同じ変換をする方法は 3 つあります。ブラウザ内(このページ)、サーバー側の変換サービス、デスクトップアプリ。差がつくのは速度ではなく、ファイルがどこへ行くかと、無料でどこまでできるかです。

観点このツールサーバー側の変換サービス
ファイルの処理場所このページのブラウザ内ベンダーのサーバー(アップロード後)
アカウント不要多くの場合必要(無料枠の制限解除に登録を求める)
無料で扱えるサイズサイズ制限なし(回数制限もなし)数ファイル/時間、または 5〜10MB 程度で課金 wall
料金無料。Pro は月 $9(大きいファイルと AI 機能のみ)サブスクが一般的。おおむね月 $7〜15(2026 年 11 月時点)
オフライン一度開けば通信不要不可
20MB を処理し始めるまで待ち時間なし(アップロードが無い)アップロードが支配的(10Mbps 上りで約 16 秒)
保証できないこと何も保存されないため、閉じたタブの内容は復元できません同じ(変換の原理は変わらない)

サーバー側のサービスが優れている点は明確にあります。巨大なファイル、チームでの共有、変換履歴の管理、スクリプトからの自動化。逆に「1 回だけ、手元のファイルを別形式にしたい」という今回の用途では、アップロードの待ち時間と登録の手間だけが増えます。

よくある質問

テキスト差分チェックとの違いは?

テキスト差分チェックは - / + 記法のテキスト出力(コードレビューに貼る用)。こちらは赤緑ハイライトのビジュアル比較で、行番号つきで「どこが変わったか」を一目で確認します。

空白の違いはカウントされますか?

デフォルトで無視します。インデントや連続スペースの違いは同じ行として扱います。文字単位で厳密に比較したい場合はオプションをオフにしてください。

上限は?

各 3000 行までです。LCS の計算量を守るための上限で、超過時は正直にエラーを表示します。

この変換で失われるもの

テキストツールはページ外に出ません。貼り付けた文字列はメモリ上で変換され、結果欄に書き戻されます。リクエストもログも保持もないため、タブを閉じた値を復元する方法もありません。

その他のテキスト処理