Toolphy

Diff Checker — Compare Two Texts Line by Line

Paste two versions of a text to instantly see which lines were added, removed, or left unchanged — all computed locally in your browser.

0
Lines added
0
Lines removed
0
Lines unchanged

Line-by-line difference

Added Removed Unchanged

Paste text into both fields to see the line-by-line difference.

How to Use the Diff Checker

Follow these steps to compare two versions of any text without sending your data anywhere. The comparison is fully automatic and updates as you type.

  1. Paste the original text. Put the first version in the left field, labelled original text. This is usually the older draft, the previous file, or the reference version you want to compare against.

  2. Paste the changed text. Put the second version in the right field. As soon as both fields contain text, the comparison updates automatically — there is no button to press. You can also use the swap button to reverse the direction of the comparison.

    Example: The original line "Welcome to the site" and the changed line "Welcome to our new site" are reported as one changed line, because the tool matches whole lines rather than individual characters.

  3. Read the highlighted result. Added lines appear in green with a plus sign, removed lines appear in red with a minus sign, and unchanged lines stay neutral. The three counters above the result show exactly how many lines were added, removed, and left unchanged.

  4. Copy the diff. Use the copy diff button to place a plain-text, unified-style version (with plus and minus prefixes) on your clipboard, and the clear button to reset both fields and start again.

    Tip: Because the comparison is line based, reflowing a paragraph onto a single line can register as one large removal plus one large addition. Keep line breaks consistent when comparing code, configuration files, or exported spreadsheets for the cleanest result.

What Is a Diff Checker?

A diff checker is a tool that compares two versions of a text and reports exactly what changed between them. Instead of reading two documents side by side and spotting differences by eye, you paste both versions and the tool produces an annotated result in which every line is classified as added, removed, or unchanged. This line-by-line view is the same principle used by version-control systems such as Git, which rely on a diff algorithm to show what a commit modified. Under the hood, this tool computes a longest common subsequence (LCS) between the two lists of lines. The LCS is the longest set of lines that appears in the same order in both texts. Any line in the original that is not part of that common sequence is marked as removed, and any line in the changed text that is absent from it is marked as added. The remaining lines form the unchanged block. Because the algorithm works on whole lines, it is precise for code, logs, and structured data, where each line is a meaningful unit. Diff checkers matter in everyday work. Developers review large code changes before merging, editors track edits between drafts, translators verify that the source and target kept the same number of segments, and anyone comparing two exports can see instantly whether a row was added or deleted. A good diff checker runs entirely in the browser, so confidential code, contracts, or personal data never leave your device.

Common Applications

1. Code review: Before merging a branch, paste the old and new versions of a file to confirm every change is intentional and nothing was deleted by accident.

2. Editing and proofreading: Compare an initial draft with a revised one to see which sentences were added, cut, or left untouched, and to check that requested edits were applied.

3. Translation quality control: Verify that a translated file has the same number of lines as the source and that no segment was dropped or duplicated during localisation.

4. Configuration and logs: Compare two versions of a configuration file or two log excerpts to isolate the one line that changed after a deployment.

5. Data exports: Check two CSV or JSON exports from different dates to confirm that new rows were added and outdated ones removed.

Added, Removed, and Unchanged Lines Explained

Every line in the result receives one of three labels. A line is added when it exists in the changed text but has no counterpart in the original; it is drawn in green with a plus sign. A line is removed when it exists in the original but not in the changed text; it is drawn in red with a minus sign. A line is unchanged when it appears in both versions in the same relative order, and it is shown without highlights. The three counters are simply the totals of each category, so you can confirm at a glance how extensive an edit really is.

Why the Comparison Is Line Based

This diff checker compares whole lines rather than individual characters. That choice keeps the result readable for code and structured files, where a line is the natural unit of change. It also makes the algorithm predictable: identical lines always match, regardless of where they appear, as long as their order is preserved. The trade-off is that editing a single word can mark an entire line as changed, and rewrapping a paragraph can look like a large deletion followed by a large addition. Keeping line breaks stable gives the most intuitive comparison.

Privacy and Size Limits

The comparison runs in your browser using plain JavaScript, which means the two texts are never uploaded and never stored on a server. To keep the page responsive, the tool refuses inputs that are too large to process comfortably: each side is limited to 1,500 lines or 200,000 characters. If you exceed the limit, the tool displays a message and pauses the comparison instead of freezing. Split very large documents into smaller sections and compare them one at a time.

Guides

Frequently Asked Questions - FAQ

Is my text sent to a server?

No. The entire comparison runs locally in your browser with plain JavaScript. Your text never leaves your device, which makes the tool safe for confidential code, contracts, and personal data.

Does it compare characters or whole lines?

It compares whole lines. Each line is classified as added, removed, or unchanged, which keeps the result readable for code, logs, and structured files. A small edit within a line marks that whole line as changed.

What algorithm does the diff use?

The tool computes a longest common subsequence (LCS) between the two lists of lines. Lines outside that common sequence are reported as added or removed, and the lines inside it are reported as unchanged.

Can I copy the result?

Yes. The copy diff button places a plain-text, unified-style version of the result on your clipboard, using a plus prefix for added lines, a minus prefix for removed lines, and a space for unchanged lines.

Is there an input limit?

Yes. To keep the page responsive, each side is limited to 1,500 lines or 200,000 characters. If you paste something larger, the tool shows a message instead of attempting the comparison.

Last updated: