Diff

Compare text changes line by line

About this tool

Enter the original and edited text, then Compare (Ctrl/Meta+Enter in an editor). Inputs are side by side on wide screens; the output is a combined line comparison. Live compares after a short typing pause. Editing immediately discards an old result; Cancel stops the background comparison without changing the inputs. Swap sides reverses the comparison, Clear empties both editors.

Only changed lines are initially shown. View can show unchanged context or wrap long lines. The two number columns refer to the original and edited texts. + is an addition, − a deletion; changes are labelled for assistive technology as well as coloured. Empty lines and a missing final line break are explicit. CRLF and CR are normalized to LF, but spaces, tabs, letter case and Unicode normalization are not ignored. This is a line comparison, not an inline character comparison.

Copy comparison copies all comparison lines, including unchanged lines and off-page content, with space/+/- prefixes and a missing-newline note. This is reference text, not an applicable patch with filenames and hunk headers. Inputs stay in page memory only and are not uploaded.

The existing local Myers implementation (jsdiff) runs in a cancellable worker. Limits per text: 1,000,000 UTF-16 code units and 20,000 lines. A difficult comparison may stop after 1.5 seconds of algorithm time or 4,000 line insertions/deletions; a 5-second outer deadline also covers worker loading. No approximate comparison is shown as exact. At most 200 result rows are mounted per page. These are product limits, not a maximum file size of the algorithm.

Open file loads UTF-8 text locally (up to 4 MB encoded, within the text limits). A UTF-8 BOM is preserved as a character. An invalid/oversized file leaves the previous input intact. Large pastes can be slow in native browser text editors; loading a file avoids the native paste operation. Late reads never replace subsequent edits or cleared/swapped inputs.