Text Compare

Compare two text blocks side by side and highlight changed lines visually — a quick online diff checker.

By Pankaj Kumar · DevToolsHub · Last updated Jun 2026

What this tool does

Paste two blocks of text into the left and right panels and this tool compares them line by line, highlighting every line that differs and generating a unified diff you can copy or share. It works on any plain text — code, JSON, config files, or plain prose — and runs entirely in your browser session.

The two situations where a text diff tool is most useful in .NET development are comparing appsettings.json files between environments (staging vs production configs diverge silently over time) and comparing EF Core migration scripts — specifically checking that a generated migration against a staging database matches what you expect before running it in production. Copy-paste comparison fails on anything larger than a few lines; a visual diff makes the differences immediately obvious.

How this tool compares text — and a known limitation

The standard diff algorithm is the Myers algorithm (1986), which finds the minimum edit script — the fewest line additions and deletions needed to transform one text into another. This is what Git, GitHub, and most IDE diff tools use. This tool uses positional comparison instead, not Myers. It compares line N on the left against line N on the right directly. The consequence: insert or delete a single line in the middle of a long text, and every subsequent line shifts by one position and gets reported as "changed" even though the content is identical. We verified this: comparing alpha/beta/gamma/delta against the same text with one line inserted after alpha reports 4 changed line pairs, when only 1 line was actually inserted. For texts that differ by insertions or deletions rather than same-position edits, expect noisy results — this is a known limitation of the positional algorithm, not a one-off bug.

How to use this tool

  1. Paste the original (or older) text into the left panel.
  2. Paste the modified (or newer) text into the right panel.
  3. Click Compare.
  4. Changed lines are highlighted in the visual diff grid.
  5. Copy the unified diff output for sharing or documentation.

Line-level vs character-level diffing

This tool performs line-level diffing — it identifies which lines changed, not which characters within a line changed. This is the standard approach used by Git because it maps naturally to how code is structured. Character-level diffing (word diff) shows the exact characters that changed within a modified line. For a character-level view, compare the two highlighted line variants side by side after identifying which lines differ at the line level.

Diffing in .NET code: when you need it programmatically

If you need text diff functionality in a .NET application (not just interactively), the DiffPlex NuGet package (DiffPlex) implements the Myers algorithm correctly and produces both inline and side-by-side diff models. It's what powers many .NET-based code review UIs. For simple line-level comparison in unit tests or scripts, string.Split('\n') and LINQ's Except can identify lines that are in one set but not the other, though this is set comparison (order-insensitive), not diff (order-sensitive).

Five real .NET debugging scenarios

  1. Comparing two appsettings.json files across environments. Paste the staging and production versions to see exactly which values differ — missing keys, changed connection strings, or feature flags that weren't updated in sync.
  2. Verifying an EF Core generated migration is correct before applying it to a staging database. Copy the Up() and Down() methods from the current and previous migrations and compare to understand the cumulative schema change.
  3. Comparing two SQL Server schema dumps from different environments. Generate the schema with SQL Server Management Studio or sqlcmd, save as text, and compare here to find tables, columns, or indexes that are out of sync.
  4. Reviewing changes to a Dockerfile or GitHub Actions workflow YAML that was edited in two branches. Paste both versions to see the differences without needing to run a Git command.
  5. Comparing two versions of a Swagger/OpenAPI specification to identify breaking changes between API versions. Paste both JSON or YAML specs to identify removed endpoints, changed parameter names, or modified response schemas.

Frequently asked questions

Why does inserting one line cause many lines to show as changed? This tool uses positional comparison (line N vs line N) rather than the Myers algorithm. A single insertion shifts every subsequent line's position, making all shifted lines appear as modifications. For texts that differ by insertions and deletions, the Myers algorithm (used by Git) produces a much cleaner result by finding the minimum edit path.

What is the unified diff format in the output panel? Unified diff is the standard output format of git diff and diff -u. Lines starting with + appear only in the right (new) version; lines starting with - appear only in the left (original) version; lines starting with a space are unchanged context lines. This format is readable by any tool that accepts patch files.

Which .NET library should I use for programmatic text diff? Use DiffPlex (NuGet: DiffPlex). It implements the Myers algorithm and provides both InlineDiffBuilder (for unified diff output) and SideBySideDiffBuilder (for split-panel views). It's the standard choice in .NET projects that need diff functionality embedded in the application.

This tool is built with ASP.NET Core 8, Blazor Server, and a line-by-line positional comparison. It runs securely on Microsoft Azure.
Input Section

Left text

alpha
beta
gamma

Right text

alpha
beta changed
gamma
Output Section

Visual diff

alpha alpha
beta beta changed
gamma gamma

Unified diff

Diff output

- beta
+ beta changed
_summary