text.compare

Compare code online

Paste two versions of a file to see a diff with syntax highlighting for more than 100 languages, detected automatically. Moved functions are marked as moves instead of big deletions and additions, and both sides are editable, with arrows to copy a change across.

Export a standard unified .patch that git apply understands, or ignore noise such as whitespace, case, timestamps or generated ids.

How to compare code

  1. Paste or drop the two versions of the file.
  2. Step through changes with F7, and use the arrows between the sides to merge blocks.
  3. Download a .patch or copy the diff to review the changes.

Questions

Can I apply the result with git?

Yes. Export, Download .patch produces a standard unified diff that works with git apply and patch.

Which languages are highlighted?

More than 100, including JavaScript, TypeScript, Python, C#, Java, Go, Rust, C and C++, PHP, Ruby, SQL, HTML, CSS, YAML and shell scripts. The language is picked from the file name or the code itself, or you can choose it.

Is it really free?

Yes, with no account, no limits and no paid tier. The code is open source under the GNU AGPL-3.0 license, so anyone can host their own copy.

text.compare

Compare two texts and see exactly what changed. The comparison runs in your browser, and this site has no ads.

Privacy

Keyboard

F7 or Alt ↓
Next change
Shift F7 or Alt ↑
Previous change
Ctrl F
Find and replace in a side
Ctrl Z
Undo an edit or merge
Ctrl S
Save the comparison to your library
?
Show this help

Tips

Free and open source under the GNU AGPL-3.0 license, made by James Patton. Get the code on GitHub and host your own copy. If it saves you time, you can buy me a coffee.

Copy this

Your browser blocked automatic copying. Select the text below and copy it.