Text Diff Checker
Line-by-line text comparison that shows every added, removed and unchanged line.
When two versions of a text need comparing - a config change, a copy edit, a pair of log exports - the useful output is a list of the lines that changed, not the whole documents side by side. This diff tool compares two texts line by line and shows the result as a color-coded list: unchanged lines in place, removed lines struck from the original, and added lines marked in green.
Paste the original text on the left and the modified text on the right, then compare. The tool computes the longest common subsequence of lines, which keeps unchanged lines aligned even when edits happen in the middle of the document, so small changes show up as small diffs instead of a cascade of redrawn lines.
The comparison runs entirely in your browser. Whatever you paste - code, configs, prose or logs - is processed locally and never uploaded, which makes the tool comfortable for content that has not shipped yet or contains sensitive material.
Features
- Line-by-line diff using the longest common subsequence algorithm.
- Color-coded result: unchanged, removed and added lines at a glance.
- Keeps unchanged lines aligned so a small edit produces a small diff.
- Copy the unified diff text (+, -, space prefix) for use elsewhere.
- Handles Windows line endings automatically.
- Per-line copy for extracting the result.
- Fully offline - the texts never leave your browser.
How to Use
- 1
Paste the original
Enter the first version in the left pane. Line breaks define the comparison unit.
- 2
Paste the modified version
Enter the second version in the right pane. It can be shorter, longer, or rearranged - the algorithm handles all cases.
- 3
Compare
Press Compare text. The result lists every line, with removed lines in red and added lines in green.
- 4
Copy the diff
Use the copy button to get a unified diff with + and - prefixes, ready for a code review comment or a patch description.
Example
Small edit in the middle
version: 1
name: box
enabled: true vs version: 1
name: box
enabled: false↓
version: 1
name: box
-enabled: true
+enabled: falseLine added
line one
line three vs line one
line two
line three↓
line one
+line two
line threeCommon Problems
Comparing formatting instead of content
Trailing whitespace and line-ending differences count as changes. If two versions differ only in trailing spaces or CRLF versus LF, the diff shows those lines as changed even when the words are identical.
Large documents
The algorithm is quadratic in the worst case, so very large inputs can be slow. For realistic config and prose files the comparison is instant; pathological inputs of tens of thousands of highly-rewritten lines are the exception.
Duplicated lines
When a line appears several times, the algorithm aligns occurrences to maximize the unchanged count. That is usually the desired behavior - ambiguous alignment is resolved in the reader-friendly direction.
A reordering looks like remove-plus-add
Moving a line is reported as one removal and one addition, because that is the truthful reading of the edit. Whole-line moves are not detected as renames; the diff shows exactly what a patch would contain.
Empty lines at the end
A trailing newline can create a phantom empty line difference. If the two panes look the same but one has a final newline, the last row may report a change - check the final line.
Expecting word-level detail
This tool diffs line by line, so a one-word change on a long line marks the whole line. For character-level detail, pair it with a word-level diff tool.
Trailing spaces inside lines
Lines that look identical on screen can differ by a trailing space, and the diff marks them changed. If whitespace differences are noise in your workflow, trim both inputs before comparing.
Case-only changes
A diff is case-sensitive, so "Enabled" and "enabled" are different lines. For prose or identifiers that differ only in case, the result correctly shows a change - decide whether that difference is meaningful to you.
Technical Details
The diff computes the longest common subsequence of lines with a dynamic program, then walks back to emit each line tagged as unchanged, added or removed in diff order.
Line endings are normalized before comparison (CRLF and CR become LF), so files exported on Windows and macOS compare correctly against each other.
The result list preserves document order: removed lines appear where they were in the original, added lines appear where they belong in the modified text.
The copyable view uses the conventional unified-diff prefix - space for unchanged, + for added, - for removed - which is what review tools and version control display.
The LCS alignment is computed over normalized line content; when two candidate alignments tie, the algorithm prefers the one that keeps more lines in their original position, which produces the most readable diffs for typical edits.
Processing is local and synchronous. The texts are compared in memory and never transmitted.
Frequently Asked Questions
What kind of comparison is this?
A line-based diff. The two inputs are split into lines and aligned by their longest common subsequence, so unchanged lines stay put and only genuine changes are marked.
Why does a single changed word mark the whole line?
Because the comparison unit is the line, not the word. A one-word change therefore colors the entire line as changed. That is the standard behavior of line diffs and matches what a version-control patch would show.
Are line endings handled?
Yes. Both CRLF and LF inputs are normalized before comparison, so a Windows export and a Unix file compare cleanly even when their raw bytes differ.
Can I use this for code?
Yes, and it is a common use - diff two versions of a script, a config or a patch fragment. For full repository diffs you would still use your version-control tool, but for quick one-off comparisons this is faster.
Is my text uploaded anywhere?
No. The comparison happens entirely in your browser. Both texts are processed in memory and never transmitted, stored or logged.
How do I read the result?
Unchanged lines are neutral, removed lines are prefixed with - and tinted red, added lines with + and tinted green. The order matches the edited document, so you can scan top to bottom like a patch.
Data & Privacy
Your data stays in your browser. Nothing is uploaded.
- Processing
- Local
- Upload
- None
- Server Storage
- None
- Account
- Not required
Related Tools
Regex Tester
Test regex patterns against your text with live highlighting, capture groups and common-pattern shortcuts.
Regex & Text
Regex Builder
Compose regular expressions from reusable blocks and watch matches highlight live against your test text.
Regex & Text
Regex Escape Tool
Escape every regex metacharacter in a string so it matches literally inside a pattern.
Regex & Text
JSON Diff
Compare two JSON documents and see every added, removed or changed value with its exact path.
JSON & Data
JSON Formatter
Format, validate and beautify JSON directly in your browser.
JSON & Data
Markdown Preview
Live Markdown preview with GFM tables, fenced code and nested lists - plus copy or download the generated HTML.
Code & Formatting