Two-pane diff in a single input box
The diff tool walks both texts line by line and pairs them by position. Identical lines are passed through with a two-space prefix; differing lines emit two output rows, the A line tagged - and the B line tagged +. The split point between text A and text B is a line containing exactly ---. Anything before that separator is treated as text A, anything after as text B.
The matching rule is byte-for-byte. Trailing spaces, tabs, and case all count, so Hello and hello are reported as different. If you want letter case ignored, use case-insensitive diff instead. Line endings are normalised to \n internally so a CRLF file pasted next to an LF file still compares cleanly.
When the two texts have unequal line counts, the shorter side is padded with empty strings. So extra lines at the end of A appear as - line with a blank +, and extra lines at the end of B appear as a blank - followed by + line. Need a structural summary instead of a line-by-line view? See compare line counts.
How to use diff two texts line by line
- 1Paste text A into the input panel, then a line with
---, then paste text B underneath. - 2The diff appears in the output panel as you type, with
-and+markers on changed lines. - 3Click Copy in the output header to copy the diff as plain text.
- 4Click Download to save the diff as a
.txtfile. - 5Swap the halves around the
---separator to reverse the direction of the diff.
Keyboard shortcuts
Drive TextResult without touching the mouse.
| Shortcut | Action |
|---|---|
| Ctrl F | Open the find & replace panel inside the input Plus |
| Ctrl Z | Undo the last input change |
| Ctrl Shift Z | Redo |
| Ctrl Shift Enter | Toggle fullscreen focus on the editor Plus |
| Esc | Close find & replace, or exit fullscreen |
| Ctrl K | Open the command palette to jump to any tool Plus |
| Ctrl S | Save current workflow draft Plus |
| Ctrl P | Run a saved workflow Plus |
How the line diff works
Position-based pairing
Line 1 of A is compared to line 1 of B, line 2 to line 2, and so on. There is no LCS or fuzzy alignment. If you insert a line at the top of B, every subsequent line registers as a change because the indices have shifted by one.
Three-hyphen separator
The split between texts is a line containing exactly ---. The separator line itself is not counted as part of either side. Without it the tool returns a friendly prompt asking for two halves.
Case and whitespace sensitive
Comparison is exact: Hello versus hello reports a change, and trailing spaces produce a diff. Switch to case-insensitive diff when letter case should be ignored.
Unequal lengths handled by padding
If A has 10 lines and B has 7, the missing 3 are treated as empty strings on the B side; you see - line with a blank insertion. The reverse holds when B is longer.
Plain-text output, no colours
Output is plain text using -, +, and two-space prefixes. That makes it easy to paste into a chat, an email, a code review note, or pipe through another tool. Need word-level granularity? Try word diff.
Worked example
The first two lines match, so they pass through with a two-space prefix. Line three changes from charlie to delta, so it emits a -/+ pair. For sub-line changes, see word diff.
alpha bravo charlie --- alpha bravo delta
alpha bravo - charlie + delta
Settings reference
| Behaviour | Effect on output |
|---|---|
| Separator | A single line containing exactly --- splits text A from text B. |
| Matching rule | Exact string equality on each line, including case and whitespace. |
| Equal lines | Pass through with a leading two-space prefix. |
| Differing lines | Emit two rows: - line-from-A then + line-from-B. |
| Unequal line counts | Shorter side padded with empty strings. |
| Line endings | CRLF and LF both accepted; output uses LF internally. |
| Missing separator | Output prompts for two halves split by ---. |
FAQ
Why is every line after my insertion marked as changed?
Does it ignore letter case?
Hello and hello are reported as different lines. Switch to case-insensitive diff for case-folded comparison.What if I do not include the --- separator?
---. The tool needs that marker to know where text A ends and text B begins.