Calcorithmevery number has an answer
πŸ”
All tools β†’
← Developer Tools

Diff Checker

Compare two texts and highlight the differences line by line.

1 Changed1 Added0 Removed
Original
Modified
The quick brown fox
The quick brown fox
jumps over the lazy dog
leaps over the lazy cat
Hello World
Hello World
β€”
New line added

How diff algorithms work

A diff (difference) algorithm compares two texts line by line (or character by character) and identifies which parts were added, removed, or unchanged. The most widely used algorithm is the Myers diff algorithm (1986), which finds the shortest edit script β€” the minimum number of insertions and deletions needed to transform text A into text B. Git, GitHub, and most code review tools use variants of this algorithm.

Reading a diff output

Standard unified diff format: --- original.txt (file A) +++ modified.txt (file B) @@ -1,4 +1,4 @@ (line numbers affected) unchanged line (starts with space) -removed line (starts with minus = was in A, not in B) +added line (starts with plus = in B, not in A) another unchanged Colour convention (used by this tool and GitHub): Red background = deleted (existed in A, gone in B) Green background = added (new in B, not in A) No colour = unchanged

Common uses for diff comparison

Code review
See exactly what changed between a pull request and the main branch before approving
Document versioning
Compare two drafts of a contract, policy, or specification to identify all changes
Configuration comparison
Compare server configs, environment files, or settings between staging and production
Merge conflict resolution
Understand what both branches changed so you can manually choose the correct version
Plagiarism detection
Compare two texts to identify copied passages and measure overall similarity
API response comparison
Check if an API response changed after a deployment or configuration update

Line diff vs. word diff vs. character diff

Different diff granularities suit different use cases. Line-level diffs (the standard in Git) are ideal for code where changes are meaningful at the line level. Word-level diffs are better for prose documents where sentences span multiple lines. Character-level diffs reveal subtle changes like spacing or punctuation that line diffs might obscure.

Line diff (standard): - The quick brown fox jumped over the lazy dog. + The quick brown fox jumps over the lazy dog. Word diff: The quick brown fox [-jumped-]{+jumps+} over the lazy dog. Character diff: The quick brown fox jump[-ed-]{+s+} over the lazy dog.

Frequently asked questions

What does a diff checker do?

It compares two pieces of text and highlights exactly where they differ β€” added, removed and changed lines β€” so you can spot edits between two versions at a glance.

Is my text uploaded anywhere?

No. The comparison runs entirely in your browser, so both texts stay private on your device.

Can I compare code as well as plain text?

Yes. It works on any text β€” source code, configuration files, articles, contracts β€” anywhere you need to see what changed between two versions.

What is the difference between a line diff and a word diff?

A line diff marks whole lines as changed, while a word diff highlights the specific words that differ within a line. Line diffs are best for code; word diffs are clearer for prose.

iFormula / How it works

Compares two texts line by line. 🟒 Green = added lines πŸ”΄ Red = removed lines 🟑 Yellow = changed lines White = unchanged

Related Developer Tools tools

JSON Formatter
Format, beautify and validate JSON data online
Regex Tester
Test regular expressions live
HTML Minifier
Minify HTML code to reduce page size and improve load times
CSS Minifier
Minify and compress CSS code to shrink file size and speed up your site
SQL Formatter
Format and beautify SQL queries
JWT Decoder
Decode and inspect JWT tokens
Cron Parser
Parse and explain cron expressions
Color Picker
Pick colors and get HEX, RGB, HSL values