Text Diff Checker
Compare two blocks of text line by line, optionally ignoring whitespace
What is Text Diff Checker?
A text diff tool compares two blocks of content line by line and highlights the differences as additions and deletions, with options to ignore trailing whitespace and letter case. It is the quickest way to compare config files, API responses, or two drafts of the same copy, and the comparison runs entirely in your browser.
How to use Text Diff Checker
- 1Paste the original content into the left pane and the new content into the right pane.
- 2Tick "ignore case" and "ignore leading and trailing whitespace" if your comparison needs them.
- 3Read the result: green lines were added, red lines were removed.
- 4The header shows how many lines were added, removed, and left unchanged.
How do I do this in code?
Use the tool above for one-off work; for anything you repeat, move it into a script or your project.
# Ignore whitespace-only differences diff -w old.txt new.txt # Produce a patch you can commit diff -u old.txt new.txt > change.patch
Common errors and how to fix them
| Symptom | Cause | Fix |
|---|---|---|
| The two sides look identical but every line is flagged as different | The two versions use different line endings (CRLF versus LF), or they mix tabs and spaces for indentation. | Normalize the line endings before comparing, or turn on the ignore-whitespace option. |
Frequently asked questions
Why is a whole line marked as changed when only one character differs?+
The comparison is line-based, so a single differing character marks the entire line as one deletion plus one addition. That matches the default behavior of git diff. When you need character-level detail, pull that one line out and compare it on its own.
Can I use it to diff JSON?+
You can, but a line-based diff is sensitive to key order and indentation. Run both sides through a JSON formatter with the same indentation settings first, then compare. For a purely structural comparison, use a dedicated JSON diff tool instead.
Related tools
All toolsJSON Diff
Compare two JSON documents structurally, by key path
Regex Tester
Test regex matches live and inspect every capture group
Case Converter
Convert identifiers between camelCase, snake_case, kebab-case, and more
Word Counter
Count words, characters, lines, and estimated reading time
AI Token Counter
Count AI tokens and estimate what a call will cost
Remove Duplicate Lines
Remove duplicate lines, optionally ignoring case and whitespace