Developer & Text Tools
Text Diff Checker
Original
7 lines · 117 characters
Changed
8 lines · 169 characters
Differences
Added lines
+1
Removed lines
−0
Changed lines
3
Unchanged
4
| 1 | function greet(name) { | 1 | function greet(name, punctuation = "!") { |
| 2 | const message = "Hello, " + name; | 2 | const message = `Hello, ${name}${punctuation}`; |
| 3 | console.log(message); | 3 | console.log(message); |
| 4 | return message; | 4 | return message; |
| 5 | } | 5 | } |
| 6 | 6 | ||
| 7 | greet("Zoë"); | 7 | greet("Zoë", "?"); |
| 8 | greet("Ada"); |
How to use this tool
- 1Paste or open the original on the left and the changed version on the right.
- 2Choose line, word or character comparison and the view.
- 3Ignore case or whitespace if those changes do not matter.
- 4Copy or download the unified patch.
Frequently asked questions
Yes. The .patch file is a standard unified diff. Rename the file headers to match your file, then apply it with git apply or patch -p1.
Ignore case treats A and a as equal, Ignore whitespace changes treats runs of spaces and tabs as one, and Ignore trailing spaces drops spaces at line ends. The diff and the patch both use these settings.
Line mode pairs changed lines and highlights the words that changed inside them. Word and character modes show the whole text with insertions and deletions marked inline, which suits prose.
Texts up to about 2 MB in total compare quickly in the browser. Beyond that the tool asks you to compare smaller sections.
No. Files you open are read and compared on your device; nothing is sent to MuhammadLab.