Text diff checker
Paste the original on the left and the changed version on the right to see every difference, down to the word. Works for code, config files, logs and plain text.
How to compare two texts
- Paste the original on the left and the changed version on the right, or drop a file on either side. The diff updates as you type.
- Removed lines are red, added lines are green, and inside a changed line the exact words that changed are highlighted.
- Choose Split to see both versions next to each other, or Unified for one column like
git diff. Long unchanged stretches fold away; click one to open it. - Set Whitespace to Trailing to ignore spaces at line ends, or Ignore to skip indentation and spacing changes entirely. Tick Ignore case to treat
Fooandfooas the same. - Copy patch gives a unified diff you can apply with
git applyorpatch -p1. The patch always holds every exact change, including ones the whitespace and case options hide.
How it works
navaja diff uses the Myers algorithm, the same one behind git diff, to find the smallest set of lines to remove and add. Changed lines are then compared word by word. Line endings (CRLF or LF) are treated the same, and a missing newline at the end of a file is reported like git does.
Everything runs in your browser in a background worker, so big files stay responsive and nothing you paste is uploaded. Each side can be up to 5 MB.
Questions
Is my text uploaded anywhere?
No. The comparison runs entirely in your browser. Nothing you paste or open is sent to a server.
Can I compare two files?
Yes. Use Open file on each side or drop a file onto it. Any text file works: code, JSON, YAML, CSV, logs, Markdown.
How do I ignore whitespace differences?
Set Whitespace to Trailing to ignore spaces and tabs at the ends of lines, or to Ignore to skip all whitespace, including indentation. This is like git diff -w.
What is a unified diff?
The text format git and patch use: lines starting with - were removed, lines starting with + were added, and @@ headers give line numbers. Copy patch produces one you can apply with git apply.
Why does it say a line changed when it looks the same?
Usually trailing spaces, tabs versus spaces, or a missing newline at the end of the file. Switch Whitespace to Trailing or Ignore to hide those.
Can it compare JSON regardless of key order?
For JSON, use the Compare tab of the JSON validator: it compares the data itself, so reordered keys and formatting don't count as changes.