Skip to content
LeedyBox
Support

Text / Code Diff Viewer

Compare two code or text snippets line by line, with added and removed lines highlighted.

Differences

Check the results before you use them. The tool is provided as is, without warranty, and its results can be incomplete or wrong. Terms of Service

The comparison is line by line. Whitespace differences count as changes, and Windows/Unix line endings are treated as equal. Changes within a line are not highlighted separately.

How to use

  1. Paste the earlier version into "Original text" and the later version into "Modified text". Both boxes start with a short JSON example that you can replace.
  2. The result under "Differences" updates while you type or paste. There is no compare button to press.
  3. Read the result from top to bottom: a line marked - on a red background was removed from the original, a line marked + on a green background was added in the modified text, and lines in gray text without a mark are the same in both.
  4. Check the counts on the same row as "Differences": they give the number of added and removed lines, and an edited line counts once as removed and once as added. When every line matches, "Both texts are identical." appears there instead.

Frequently asked questions

Is the text I compare uploaded or saved?

No. The comparison runs in your browser with JavaScript, and the text you paste is not sent to LeedyBox. The tool does not save it either.

Why are two lines shown as removed and added when they look the same?

Lines are compared exactly, character by character, so a trailing space, a tab instead of spaces, a non-breaking space instead of a normal space or an invisible zero-width character is enough to make them differ. Many accented letters can also be stored in two Unicode forms, as one character or as a letter followed by a combining accent, which look the same but do not match. Upper and lower case letters count as different too. Windows and Unix line endings are treated as equal, so they are not the cause.

Why does an empty line appear as added or removed at the end?

Usually one text ends with a line break and the other does not. The text is split at every line break, so a line break at the very end adds an empty last line. Make both texts end the same way and the extra line goes away.

How are edited and moved lines shown?

The tool looks for the largest number of lines that appear in both texts in the same order and marks every other line as removed or added. An edited line therefore appears as a removed line plus an added line, usually with the removed one first; when several lines in a row are edited, the removed lines usually come first as a group. Moves are not detected as such: a move shows up as lines removed in one place and added in another. When a block of many lines moves past a few other lines, those few lines may be the ones shown as removed and added, while the block itself stays unmarked.

Can I use the result as a patch for git apply or the patch command?

No. The result shows all lines, with + in front of added lines, - in front of removed lines and two spaces in front of unchanged lines. Unlike a unified diff, it has no @@ hunk headers with line numbers and no --- and +++ lines with file names, so git apply and the patch command cannot read it. Use it to review changes, and create patch files with git diff or diff -u.

How much text can I compare?

Lines that match at the start and at the end of both texts do not count toward the limit, and they are still shown in the result. If the number of remaining lines in the original multiplied by the number of remaining lines in the modified text is more than 4,000,000, for example 2,500 against 2,000 lines, the tool shows a message instead of a result. In that case, compare the texts in smaller parts. Below the limit, long texts can still make the page slow to respond while you type, because the comparison runs again after every change.

Why does reformatted JSON or code show so many changes?

The tool compares text, not meaning, so new indentation, reordered keys or a line split in two all count as changes. Format both versions the same way, with the same indentation and key order, before you compare them, so that the differences that remain are mostly changes in content.