Code Diff

Compare two code files or text blocks line-by-line.

About the Code Compare

Paste two versions of a file and the tool lines them up, marking lines that exist only in the first version as removed and lines only in the second as added.

Everything you enter is processed in your browser; nothing is uploaded or stored.

How to use it

  1. Paste the original text or code into Code A.
  2. Paste the changed version into Code B.
  3. Press Compare to see the line-by-line differences, with line numbers.

How the diff checker compares text

The comparison works on whole lines. Each line of B is matched against A; a line that appears in A but not in B is shown as removed, a line that appears only in B is added, and matching lines are shown unchanged for context.

Because it compares lines rather than characters, changing one word marks the whole line as removed and re-added. That is usually what you want for code review, config files and contracts, where you need to find which lines moved or changed.

Example

Comparing a .env file before and after a deploy: if only DB_HOST changed, you will see the old DB_HOST line as removed and the new one as added, with every other line unchanged.

Tips

  • Trailing spaces count as a difference. If two lines look identical but are flagged, check for invisible whitespace or tabs versus spaces.
  • For JSON, the JSON Compare tool ignores key order and is more useful than a text diff.

Frequently asked questions

Is this a free diff checker?

Yes. It is free with no sign-up, and both texts stay in your browser – nothing is uploaded.

Can I compare code in any language?

Yes. The comparison is plain text, so it works for JavaScript, Python, SQL, HTML, config files or prose alike.

Why is a whole line marked when I changed one character?

The tool compares line by line, so any change inside a line marks that line as removed in A and added in B.