toolbench.onlineby Valkyron Labs

Developer

Text Diff Viewer

Compare original and updated text one line at a time. Matching lines stay put, and changed lines are marked removed or added. Sample presets fill both boxes.

Text Diff Viewer

Compare two text blocks line by line, by row index.

Line diff

  

Output actions

Ready to copy output once your result appears.

Index-aligned lines, not a smart diff

Text Diff Viewer compares Original text with Updated text by line number. Line 1 is compared with line 1, line 2 with line 2, and so on. A matching line is printed with two leading spaces. A mismatch prints a minus line and a plus line. Inserting a row shifts every later row, so this is not a move-aware diff.

How to compare two texts

  1. 1Paste into Original text and Updated text, or choose a Compare preset. The presets are API response drift, Environment config, and Copy editing. Custom is the menu value when you type.
  2. 2Read Line diff. It refreshes as you type. You do not need a button to see it. Matching rows start with two spaces. Changed rows are a minus row and a plus row.
  3. 3Press Copy output for that block. Record diff action does not recompute the lines. It only records that you clicked. This tool has no download control.

What it is good for

  • • A short pair of configs or paragraphs where the same row still means the same row.
  • • Loading one of the three sample pairs without retyping them.
  • • Seeing an insertion as a cascade of mismatches, which tells you the compare is positional.

Example

Input

Original:
a
b
c
Updated:
a
c

Output

  a
- b
+ c
- c
+ 

Line 1 matches. Line 2 is b against c. Line 3 is c against a missing updated line, so the plus row is a plus sign and a space. The last character of the block is that space.

What a line marker means

Each side is split on \n only. A carriage return stays on the line, so a Windows row that still contains \r will not match the same letters without \r. The longer side decides how many rows exist. A missing row on the short side is the empty string, not a skipped comparison. When both strings at that index are equal, the row is two spaces plus the text. When they differ, the block emits a minus, a space, and the original line, then a newline, then a plus, a space, and the updated line.

The sample a / b / c against a / c is the cascade. Row 1 is two spaces and a. Row 2 is minus b and plus c. Row 3 is minus c and plus, then a space, because the updated side has no third line. A reader who expected the tool to notice that c only moved down will not see a single deletion of b. The page never computes a longest-common-subsequence alignment. Equal lines stay matched only while they share an index.

Presets and the record button

Compare preset lists Custom, API response drift, Environment config, and Copy editing. Choosing a named preset replaces both panes and sets the menu to that preset. API response drift puts {"status":"ok","count":2} on the left and {"status":"ok","count":3,"page":1} on the right, each as one line, so the diff is a single minus row and a single plus row. It does not parse JSON. Environment config is two KEY=value lines on each side. Copy editing is Fast setup / Zero config / Quick start against Fast setup / Zero configuration / Instant start. The first of those three rows matches. The other two are replacements at the same indexes.

Typing in either pane sets the menu back to Custom and keeps what you typed. It does not restore the text from before the preset. The page stores a short list of preset keys you picked, but it never shows that list, so there is no history menu to reopen an older custom draft. Record diff action leaves Line diff untouched. If the block looks wrong, the panes are the cause, not a missed click on that button. Copy output copies the block that is already visible, including the two-space prefix on unchanged rows.

Jobs for a positional reading

Use the panes when a line's position is the identity: env files with the same keys in the same order, a stanza you edited in place, or the Copy editing preset. The markers are easy to scan because a change is always a pair of rows and a match is always an indented row. JSON with added keys is a poor fit when you care about the key rather than the character line. The JSON compare tool walks property paths. The API preset on this page is only two strings, so a new key looks like the whole line was replaced.

Rewriting text, rather than viewing it, is Find & Replace. Joining or splitting lines before you compare them is line operations. This viewer will not ignore whitespace, will not hide unchanged rows, and will not diff inside a line at word level. Zero config against Zero configuration is one full-line replacement even though the words share a prefix.

Blank rows, a fresh visit, and saved panes

Two empty panes are one empty row compared with one empty row. They count as equal, so Line diff is two spaces and nothing else. That value is published after the page hydrates, and Copy output will copy those two spaces. A blank line in the middle of both panes is the same two-space row. A blank line on only one side is a minus or plus row whose text is empty, which still includes the sign and the following space.

Both panes, the selected preset name, and the unshown preset-key list are written to local storage for this browser and restored on the next visit. A reload brings the last pair back. It does not offer a button to forget them. Clearing the browser's site data does. The record button is not a save action. The save already happened when the panes changed.

Rules and limitations

Lines are paired by index after a split on newline. Carriage returns stay. Equal rows are two spaces plus the text. Unequal rows are a minus row and a plus row. A missing side is the empty string.

Presets replace both panes. Editing returns the menu to Custom without an undo stack. Record diff action does not change the diff. Panes are restored from local storage. There is no download and no word-level compare.

Common problems

If every line after an insertion looks changed, the compare is positional. A new row pushes the later rows onto new indexes. This page will not realign them.

If Record diff action seemed to do nothing to the text, that is what it does. The block you are looking at is already the result.

Frequently asked questions

Does it detect a line that moved?

No. Row N on the left is compared only with row N on the right. Inserting b's neighbor so that c shifts down marks both the shifted row and the leftover row.

What does Record diff action change?

Nothing in the panes or in Line diff. The block updates while you type and when you pick a preset. The button only records the click.

Are the sample presets a JSON diff?

No. API response drift compares two single lines of text. Added keys are not listed as paths. JSON compare is the tool that walks properties.

Do the panes survive a reload?

Yes. Original text, Updated text, and the preset menu value are restored from local storage in this browser. The page does not show the preset-key history it also stores.

Is my input uploaded or saved?

This tool processes input in your browser and does not save its input or output to local storage. Copy and download are user actions. The site uses analytics for page and action metadata and may use ads and production error reporting; see the Privacy Policy for those services.

About this tool

Maintained by Toolbench. For large or deeply nested files, split the input into smaller batches and verify representative results before using them in an import or application. Report reproducible problems through Contact.

Next steps

Related tools

Continue the workflow with nearby tools for formatting, publishing, debugging, or follow-up checks.

Trust

Policies, contact, and answers

Clear pages for how Toolbench works, what we collect, and how to reach us.