Skip to content
Free text tool

Line-by-line text diff

This diff checker compares a before and after version of some text and shows which lines were added, removed or kept. Writers, editors and developers use it to check changes in notes, lists, config files and code snippets.

  • Runs in your browser
  • Free, no account needed
  • Copy or download the result

Your input

155 characters

Line comparison
Trim spaces ignores spaces at the start and end of lines.

Result

--- Before
+++ After
@@ -1,4 +1,5 @@
 Order received
 Packed by Lin
-Delivery Friday
-Signed by front desk
+Delivery Monday
+Left at back door
+Photo sent to customer

The short answer

A diff lists what was removed from the first text and what was added in the second, with unchanged lines shown as context. A line starting with - was removed, a line starting with + was added, and a line starting with a space is the same in both. The @@ header gives the line ranges.

Formula@@ -start,count +start,count @@ gives the line range in the old text and in the new text; - means removed, + means added

Worked exampleThe sample compares a 4-line text with a 5-line text under the header @@ -1,4 +1,5 @@. Delivery Friday and Signed by front desk are removed, and Delivery Monday, Left at back door and Photo sent to customer are added.

Example

Input
Order received
Packed by Lin
Delivery Friday
Signed by front desk
---
Order received
Packed by Lin
Delivery Monday
Left at back door
Photo sent to customer
Result
--- Before
+++ After
@@ -1,4 +1,5 @@
 Order received
 Packed by Lin
-Delivery Friday
-Signed by front desk
+Delivery Monday
+Left at back door
+Photo sent to customer

How to use the line-by-line text diff

  1. Paste the before text in the box, add a line with only ---, then paste the after text.
  2. Set Line comparison to Exact or Trim spaces.
  3. The differences update as you type. Press Run any time to refresh them.
  4. Press Copy result, or Download to save the diff.

How it works

Lines starting with - were removed, lines starting with + were added, and lines starting with a space are unchanged.

The output begins with --- Before, +++ After and a line count header, in the style of a unified diff.

The input must contain exactly one line that is just ---. Text with other --- lines is rejected.

Each block can have at most 500 lines. The comparison is case-sensitive and works on whole lines, not single words.

If both blocks match, the result says No line changes. Trim spaces ignores spaces at the start and end of each line.

Everything runs in your browser. Your input is not uploaded or stored. If you use Copy link, what you entered is placed in the link.

Questions and answers

How do I compare two texts for differences?

Paste the first version, a line containing only ---, and then the second version. Each added and removed line appears as you type.

Does it show changes inside a line?

No. It compares whole lines, so a line with one changed word shows up as one removed line and one added line.

Why do I get an error about ---?

The tool needs exactly one line holding only three hyphens to split the two texts. Add that line, or remove extra ones from your text.

Is my text uploaded?

No. Both versions are compared locally in your browser.

Last updated November 1, 2026. Maintained by SnowRock. How our tools work

All 220 SnowRock tools