Text Diff

Two large text areas—edit on the left and right. Line breaks define rows: unchanged rows use a light neutral tint, deletions tint the left (red), additions tint the right (green); the opposite side shows a diagonal pad stripe for alignment. When rows differ, +/− counts appear in the header—copy unified diff (− / + / leading space lines) from there into tickets or chat.

Why line diffs feel simple but read differently from tools you already use

This page compares two pasted texts by splitting on line feeds only: the diff kernel is longest-common-subsequence (Myers-style) over the line arrays, so it finds an order-preserving alignment, not “moves” or intra-line edits. Windows CRLF is preserved in what you paste; only the \n boundaries define rows. When you need column order noise gone, align keys first with JSON key sorter or pretty-print both sides in JSON formatter & beautifier before diffing.

Side-by-side highlighting is editorial review: it does not parse JSON/YAML/SQL semantics. For structured payloads, a tree diff (e.g. JSON compare) can still disagree with line diff when keys reorder or when minified blobs sit on one line. For byte-level or character-level budgets after edits, cross-check with text statistics so limits from Twitter bios or DB VARCHAR caps stay honest.

What line-based LCS diff assumes, and where semantic or byte tools diverge

How the line alignment is built from a longest common subsequence over rows

  1. Each row is one string ending at the next \n; no automatic CRLF normalization—only those boundaries split “lines”.
  2. The LCS walks both arrays to maximize unchanged rows while keeping original order; it does not label blocks as “moved”, only delete/insert pairs.
  3. Identical rows that repeat can match either occurrence; reviewers sometimes see a “wrong” pairing when duplicates abound—dedupe or add sentinel comments first.
  4. Empty strings between newlines are real lines: an extra blank line is an added row, not invisible padding.

Why changed characters inside one line make the whole row “red then green”

  1. There is no intra-line token diff here—one stray tab or comma makes the entire line a removal plus an addition.
  2. That matches many config reviews (helm values, .env) where a line is the deployable unit; it punishes prose where edits are word-sized.
  3. Word-wrapped paragraphs without inner newlines become one giant row: prefer hard breaks, Markdown source, or a paragraph-specific tool when you need finer grain.
  4. Trailing spaces and non-breaking spaces are part of the line string; they cause “no visible change” mysteries until you hex or normalize.

When to normalize newlines, pretty-print, or sort before a fair comparison

  1. CRLF vs LF-only often produces a full-file churn—convert both sides the same way or diff will shout on every line ending.
  2. Minified JSON is a single line: any edit retouches that line; use the formatter to expand structure, or use JSON compare for object-aware diffs.
  3. Key order in JSON objects is semantically irrelevant but line-noisy; sorting keys removes false positives when the schema is stable.
  4. Large logs benefit from slicing timestamps or request IDs the same way on both sides so LCS aligns error lines instead of interleaving unrelated stacks.

What this differs from git diff, Word track changes, or ICU collators

  1. Git adds file headers, hunk limits, and optional word-diff; this page is only equal-line alignment with no repository merge base.
  2. Word counts revisions and author balloons; it may treat soft breaks and fields differently from raw \n rows.
  3. Unicode normalization (NFC/NFD) can make two visually identical lines differ at the code-unit level—normalize both sides when enforcing AML or legal copy.
  4. Binary, Word .docx, and PDF need importers or hex tools; paste extracted plain text here only after decoding.

Where a fast line diff beats a semantic diff, and where it does not

Helm values or .env before a rollout

Line units match what operators eyeball in PR comments—pair with secret scanners elsewhere; here you only see literal text drift.

API JSON bodies after pretty-print

Once both sides share indentation, line diff highlights field-level edits; still verify ordering requirements if your client compares canonical JSON bytes.

Frequently asked questions

How do I compare two text files or two pasted configs side by side?
Use the left column for the older or baseline text and the right column for the revised text in the same aligned row view—each line break starts a new row, and insertions or deletions get color on that row. The header bar’s copy control exports a unified diff (− / + / context lines) you can paste into email or tickets. If the only delta is CRLF, normalize line endings in both sides first or you will see every line as changed—editors like VS Code show the ending style in the status bar to match intentionally.
Why does moving a block of lines look like many deletes and adds instead of one move?
Line LCS does not model “cut here, paste there”; it preserves the original top-to-bottom order in each version, so relocated lines look like deletions at the old offset and additions at the new one. Git’s patience or histogram diffs sometimes surface moves; Word processors may do paragraph tracking instead. When moves are the story, keep a numbered outline or use a tool with explicit move detection so reviewers are not fooled into thinking content vanished.
My minified JSON diff is almost the whole file—what should I do first?
Minified blobs treat the file as one or a few giant rows, so any character change repaints an enormous line. Run both sides through the same formatter indentation—see JSON formatter & beautifier—so each property sits on its own row. For schema-aware comparison, JSON compare can still disagree on key order; sort keys first if order is not part of your contract.
Does a blank line or a line with only spaces count as a difference?
Yes. An empty string between newlines is still a row, and spaces are characters inside that row unless you trim externally. Marketing copy pasted from web often hides non-breaking spaces or soft hyphens that look like ordinary spaces—when counts disagree with expectation, normalize Unicode or show invisible characters in your editor before diffing.
Is this the same result I would get from git diff on the same two texts?
Conceptually both are line-oriented, but git wraps hunks, shows file metadata, and can apply word-level coloring. This page feeds your two buffers with no index, so there is no rename detection, binary safety checks, or conflict markers. For versioned projects, trust git for merges; use this when two clipboard snapshots never touched a repo.
Can I diff Excel, PDF, or images here?
No—the engine consumes plain Unicode text only. Spreadsheets carry formulas and merged cells that plain export might flatten incorrectly; PDFs need text extraction that drops layout. Export CSV or copy visible table text first, then compare. For binary safety review, use specialized diff or hash tools outside this page.
Why do two “identical” paragraphs still show a changed line?
Hidden Unicode (zero-width joiner, BOM, different quote characters), mixed tabs and spaces, or soft line breaks from Google Docs versus hard newlines all change the string even when glyphs look alike. NFC vs NFD normalization matters for accented Latin and some Asian scripts. Strip styling in a plain editor, normalize quotes, and retry; if limits matter, verify length with text statistics using the same normalization your CMS applies.
When should I switch from line diff to a structured or byte-aware tool?
Use tree or schema diff when key order is irrelevant or when you only care whether JSON values changed, not pretty indentation. Use byte counters when an API documents UTF-8 octet caps—line edits might shrink visible text while raising bytes due to emoji. For CSV rows, sometimes cells reorder; a grid diff or SQL export comparison can be clearer than line noise from wrapped strings.