Text Diff — Line-by-Line Diff & Document Comparison
Compare text line by line: additions in green, deletions in red
About This Text Diff Tool
This tool compares two blocks of text line by line. Added lines are highlighted in green, deleted lines are marked in red, and unchanged lines have no background; each difference also gets a colored left border for easier scanning. The footer shows +added / -removed / =unchanged line counts so you can gauge the size of the change at a glance.
Common Use Cases
Code review: compare code before and after changes to quickly spot added, edited and removed lines. Document proofing: compare contract clauses, technical documents or papers before and after edits to make sure nothing was missed. Config management: compare versions of server config files or environment variables to trace issues caused by config changes. Copywriting: compare article or copy drafts to check for omissions or accidental edits. To format code before comparing, use the JSON Formatter or SQL Formatter first.
FAQ
What algorithm does the text diff use?
The tool splits both texts into lines and compares them line by line. When the two texts have different line counts, the extra lines are marked as added or deleted. Line-by-line comparison suits most text-diff scenarios and produces clear, intuitive output.
Can it compare code?
Absolutely. You can compare any text content, including source code, JSON, XML and Markdown. The output uses a monospace font, so indentation and alignment stay clearly visible.
Can I save the diff result?
Yes. Use the "Copy Result" button to copy the diff (with +/- markers) to your clipboard, then paste it into any document or note to save it.