PDFのミカタ

プログラムの差分を確かめる

公開日:2026年10月19日|最終更新:2026年10月19日|運営者情報

この記事のポイント
  • 貼る
  • 見る

プログラムを修正したあと、どこを変えたのか確認したい。設定ファイルが、前のものと何が違うのか知りたい。2つの文章の違いを調べる なら、コードも比べられます。

手順

  1. 「文章A(前)」に、変更前のコードを貼り付けます。
  2. 「文章B(後)」に、変更後のコードを貼り付けます。
  3. 「比べる」を押します。
  4. 「違いを見る」で、追加された行と削除された行を確認します。
字下げの違いだけを無視したい場合は、「行の前後の空白を無視する」を使えます。ただし、Pythonのように字下げに意味がある言語では、無視すると、見逃す場合があります。

向いている場面

使い方のコツ

本格的な開発では

チームで開発するなら、Gitなどのバージョン管理が適しています。このツールは、手元で、ちょっと2つのコードを比べたいときに便利です。

注意すること

設定ファイルの比較のコツ

例

本番と開発の設定ファイルが、なぜか動作が違った。2つを貼り付けて比べたところ、接続先の1行だけが違っていた。

つまずきやすい点

よくある質問

大きなプロジェクト全体を比べられますか?

いいえ。ファイル単位で、貼り付けて比べます。

まとめ

2つのコードや設定を貼り付けて比べる。手元の簡単な確認に使い、本格的にはバージョン管理を使いましょう。

2つの文章の違いを調べるを使う(無料)

あわせて使えるツール

この解説が役に立ったら、応援してもらえるとうれしいです。

応援する(300円)ほしい物リストで応援

同じツールの、ほかの解説

解説の一覧を見る

Checking Differences in Code

Published: Oct 19, 2026 | Updated: Oct 19, 2026 | About (Japanese)

Key points
  • Paste
  • Look

After modifying a program, you want to check what you changed. You want to know how a configuration file differs from the previous one. Compare Two Texts (Diff) can compare code too.

Steps

  1. Paste the code from before the change into "Text A (before)".
  2. Paste the code after the change into "Text B (after)".
  3. Press "Compare".
  4. Check the added and removed lines under "See the differences".
If you want to ignore indentation-only differences, you can use "Ignore spaces at the start and end of lines". But in languages like Python, where indentation matters, ignoring may cause you to miss changes.

Good for

Tips for use

For serious development

For team development, version control such as Git is suitable. This tool is handy when you simply want to compare two pieces of code at hand.

Cautions

Tips for comparing configuration files

Example

Production and development configuration files somehow behaved differently. Pasting both and comparing showed just one line, the connection target, differed.

Common stumbling blocks

Frequently asked questions

Can a whole large project be compared?

No. Paste and compare file by file.

Summary

Paste two pieces of code or settings and compare. Use it for quick checks at hand, and use version control for serious work.

Use "Compare Two Texts (Diff)" (free)

Tools that go well with this

If this guide helped, a small tip would mean a lot.

Send a tip (¥300)Send a gift (Amazon wishlist)

More guides for this tool

See all guides