Text / Code Diff

Compare two versions line by line, see additions and removals, and copy a unified diff.

On your device. Your input is not uploaded or saved.

Line comparison with character highlights. Spaces and the final newline count as changes; Windows and Mac line endings are normalized to LF. Either input can be empty.

Up to 250,000 characters and 10,000 lines per input. Large, very different inputs may exceed the processing limit. Editing either input clears the comparison. Text is never executed or uploaded.

How to compare two texts

  1. Paste the earlier version into Original and the newer one into Modified.
  2. Press Compare. Added lines are marked with a plus sign, removed lines with a minus sign, and changed characters inside replaced lines are highlighted.
  3. Turn on Ignore leading and trailing whitespace to hide indentation-only changes, or press Swap to reverse the direction.
  4. Press Copy diff to copy the whole comparison as a unified diff.

How the comparison works

The texts are compared line by line. Each change is shown with three lines of context and with its old and new line numbers. Within a block of replaced lines, changed characters get a stronger highlight, so a renamed variable or a fixed typo stands out.

Spaces and a missing final newline count as changes. Windows (CRLF) and old Mac (CR) line endings are converted to LF before comparing, so texts that differ only in line endings are reported as identical, with a note.

Unified diff output

Copy diff produces a unified diff with @@ hunk headers, the format used by git diff and diff -u, so you can paste it into a code review, an issue or a chat. It includes every change, even when the page shows only part of a long comparison. With Ignore leading and trailing whitespace on, the patch may not apply cleanly to the original text.

Limits

Each input can have up to 250,000 characters and 10,000 lines. Large inputs that are very different may exceed the processing limit; compare smaller sections instead. For very large or complex changes, character highlights may be skipped, but the line diff and the copied patch stay complete.

Where does my data go?

The comparison runs in a background worker in your browser. The tool never executes, uploads or saves your text.

Like the rest of the site, this page uses Google Analytics and Yandex Metrica, including Metrica session replay. Tool events report only that the tool was opened or used.

The tool area is marked so that Metrica masks what you type and the results in its session recordings.

Also useful

No third-party trackers on JZR Tools. We count anonymous visits with country, referring site and device type only.