Text Diff
Compare two pasted texts line by line.
About this tool
Lines that appear only in the second text are marked added. Lines that appear only in the first are marked removed. A line that moved may show up as a removal plus an addition.
JSON Diff is the page that parses JSON before comparing. This page compares the text as text.
How to use it
- Paste the original text.
- Paste the text to compare it with.
- Compare. Added and removed lines are marked.
Limitations
- The diff is by line. It does not compute a character-level patch.
- Both texts are whatever you paste. The page does not open files from disk unless you paste their contents.
A line LCS, not a character patch
How a row gets a mark
Both pastes are split into lines after carriage returns are normalized. The page then finds a longest common subsequence of those lines. A line that sits in that common sequence is printed with two leading spaces. A line only in the first paste is printed with a minus. A line only in the second paste is printed with a plus. The algorithm walks backward through the score table, so the printed order is the forward order of the edit, not a sort. Equal lines match only when the whole line is equal. A one-character typo makes the entire line a deletion plus an insertion.
Why a small edit looks large
Change one word in a long paragraph that is a single line, and the diff shows the whole paragraph removed and the whole paragraph added. That is the cost of a line diff. It will not mark the word. Split the paragraph into lines first if you want finer rows, knowing that you changed the text in order to see the edit. Moved blocks can look like a deletion in one place and an addition in another, because this is not a move detector.
What you have to paste
The page compares the two boxes. It does not open a pair of files from disk by path, and it does not know which side is “theirs” except by the order of the boxes. There is no ignore-whitespace switch. Trailing spaces make lines differ. There is no word-wrap adjustment. Compare the texts you mean to compare, not a wrapped view of them.
Common lines need a run of exact matches
A file that was rewrapped so every line is shorter will show almost everything as changed, even when the words are the same. Join and wrap both sides to the same width before you compare, if the wrap is not itself the edit you care about. The score is a line match, so identical lines far apart can still anchor the common sequence.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

