Skip to content

Code diff

Compare two code snippets line by line with line numbers.

Processed on your device

  1. How it works
  2. 1Paste the original and modified code.
  3. 2Choose split or unified view.
  4. 3Copy or download the patch.
Loading tool…

About Code diff

Compare two code snippets line by line with line numbers, in split or unified view. You can ignore whitespace changes and download the differences as a .patch file.

Example: compare a configuration file before and after a change to see exactly which lines were modified. If only the indentation changed, turn on “Ignore whitespace” so it does not show up as a difference.

Frequently asked questions

Is my text saved or sent anywhere?

No. The text is processed in your browser and never leaves your device.

Can I apply the patch with Git?

Yes. The .patch file uses the standard unified format understood by git apply and patch.

What is the split view?

It shows the original and modified versions side by side, with matching lines aligned.

  • JSON formatter

    Format, validate, minify and sort JSON with syntax highlighting.

  • Base64

    Encode and decode text or files in Base64 (UTF-8 and URL-safe).

  • URL encoder

    Encode and decode URLs and inspect their parts and parameters.

  • Merge PDF

    Combine several PDFs into a single document in the order you choose.