A snippet comes back from a review, a teammate or a chat with the note "fixed it, one small change." You open both versions side by side and read them twice, and they look identical, except they cannot be, because one of them behaves differently. Somewhere in those lines a value changed, a flag flipped or a line quietly appeared, and eyeballing two blocks of code is the slowest possible way to find it.

That is the everyday question a diff answers: what actually changed between these two drafts? This guide shows how to answer it in seconds with the free Text Diff Checker on Ovatly. The method is two passes: lines first, to locate the change, then words, to identify exactly what inside the line is different.

Contents

  • Quick answer
  • Lines first, words second: the two-pass method
  • Compare two snippets, step by step
  • Worked example: one changed value and one added line
  • Limitations and honest cautions
  • Common mistakes
  • FAQs
  • Conclusion

Quick answer

Paste the original snippet on the left of the Text Diff Checker and the changed version on the right, choose Lines, and read the highlighted result with its added, removed and unchanged counts. Every touched line shows up at once; a changed line appears as one removal plus one addition. Then take the changed line that matters and compare it in Words mode to see the exact words that were swapped. The whole comparison runs in your browser and nothing is uploaded.

Lines first, words second: the two-pass method

The checker offers two levels of granularity, and using them in the right order is what makes the check fast.

Lines mode compares whole lines, which is the natural unit for code, configs and lists. It answers the locating question: which lines were added, which were removed, and which are untouched. A line that was edited counts as a removal plus an addition, the same model Git uses, because the old text of the line is gone and new text stands in its place. The counts shown with the result keep this honest: you see added, removed and unchanged lines, not a vague claim that the files differ.

Words mode compares word by word, which the tool intends for prose, where a one-word edit inside a long sentence should not mark the whole sentence as replaced. For code it earns its place as the second pass. A changed line in a snippet is often a long condition or call where a single value, flag or variable name moved, and lines mode alone cannot tell you which token it was. Words mode can: comparing "the quick fox" with "the slow fox" reports 1 word added and 1 word removed, and the same precision applied to a line of code isolates the one number or name that changed.

There is no character-level mode, and for snippet review there rarely needs to be: lines locate, words identify.

Compare two snippets, step by step

  1. Open the Text Diff Checker and paste the original text on the left.
  2. Paste the changed text on the right.
  3. Choose Lines for code and structured text, or Words for sentences and paragraphs.
  4. Read the highlighted result and the added, removed and unchanged counts.
  5. For any changed line where the difference is not obvious, run that line through Words mode to isolate the changed words.

Worked example: one changed value and one added line

Here is the original of a small shipping function:

function shippingCost(weight) {
  if (weight <= 5) {
    return 4.99;
  }
  return 9.99;
}

And here is the version that came back:

function shippingCost(weight) {
  if (weight <= 10) {
    return 4.99;
  }
  console.log("heavy parcel");
  return 9.99;
}

In Lines mode the checker reports 2 added, 1 removed and 4 unchanged lines. Reading that result takes seconds: the if line is the changed line, counted once as removed in its old form and once as added in its new form, and the console.log line is the second addition, a line that simply was not there before. Everything else is confirmed untouched, which is the other half of the value: you now know the fix did not quietly rewrite the returns.

Lines mode tells you where, but not what. The old and new if lines differ by one token, so the second pass runs them in Words mode: 1 word removed and 1 word added, the threshold value itself, 5 replaced by 10. The review question changes from "what did you touch" to "should the free-shipping threshold really double", which is the conversation worth having, reached in two passes instead of two full readings.

Limitations and honest cautions

The checker compares pasted text, not code. It has no understanding of syntax, so it cannot tell you whether the changed snippet still runs, and it keeps no history: there is no blame, no record of who changed what or when. It answers what differs between the two texts you hand it, nothing more.

It also compares sequences, not meaning. Move a function from the top of a snippet to the bottom and the result shows the block as removed in one place and added in another, even though the code is functionally the same. Read moved blocks with that in mind before concluding that content was deleted.

Very large pasted texts, such as whole log files, will still work but can take a moment to compare. And the result lives on the page as highlighted text with counts; the checker does not produce a patch file. If you need a patch file to apply or share, a Git diff is the better format.

Common mistakes

  • Pasting the versions the wrong way round. The original belongs on the left and the changed text on the right. Swap them and every addition reads as a removal, which inverts the story of the change.
  • Reading a changed line as two separate edits. A removal plus an addition on the same line is one edited line, counted twice by design. Treating it as a deletion and an unrelated insertion leads to bad conclusions about what the author did.
  • Stopping at Lines mode on a long line. A one-token change inside a dense condition is invisible at line level beyond the fact that the line changed. The Words pass exists for exactly that line.
  • Diffing snippets that were re-wrapped between versions. Lines mode compares lines as they stand, so the same code broken into different lines shows as change throughout. Align the formatting of both versions first if you want the diff to show substance rather than layout.
  • Expecting a verdict on correctness. The diff shows what changed, never whether the change is right. A clean, tiny diff can still be a wrong fix.

FAQs

Which mode should I use for code? Lines. Code, configs and lists are built from lines, so the line is the natural unit of change. Words mode is the follow-up for prose, or for isolating the changed words inside one long line.

Why does one edited line show as both removed and added? Line mode treats a changed line as a removal plus an addition, the same model Git uses. The old version of the line is counted as removed, the new version as added, and the counts show both.

Why did my moved function show as deleted and re-added? A diff checker compares sequences, not meaning. Moving a block looks like removing it in one place and adding it in another, which is exactly what the highlight shows.

Can I compare character by character? No. The checker offers two levels of granularity, Lines and Words. For most snippet reviews that is enough: lines locate the change, words identify the exact token that moved.

Is my code uploaded anywhere? No. The comparison runs entirely in your browser, so drafts, contracts and code are never uploaded.

Conclusion

Fast snippet review is a habit of two passes: lines to locate, words to identify. Paste both versions into the Text Diff Checker, trust the counts to tell you how much actually moved, and spend your reading time on the lines that changed instead of the ones that did not. The companion guide on how to generate placeholder paragraphs for a print layout test covers filling a document before its real content exists, and the rest of this series lives in the Developer Tools guides archive.