100% Client-Side WASMZero Remote NetworkVerified Spec

Text Diff

Interactive Studio

Compare two blocks of text and highlight the added and removed lines. Instant feedback with zero server storage.

Loading tool…

About Text Diff

This tool compares two blocks of text line by line and highlights what changed between them, using the same underlying idea as the "diff" utilities built into version control systems like Git. Rather than just flagging that a line differs, it computes the longest common subsequence (LCS) — the longest run of lines that appear, in order, in both versions — via dynamic programming. Any line that's part of that shared sequence is marked unchanged; everything else is classified as removed (present in the original but not the longest common thread) or added (present in the changed version but not in it).

This line-level, LCS-based approach is why moving a paragraph or inserting a single line in the middle of a document doesn't cause every following line to show as changed — the algorithm finds the longest matching skeleton between the two texts and only flags the genuine insertions and deletions around it, rather than doing a naive line-by-line positional comparison that would misalign everything after the first edit.

This is useful for reviewing edits between two drafts of a document, comparing two versions of a config file or code snippet pasted from different sources, or spotting exactly what text changed in a paragraph that was revised.

How to use Text Diff

  1. Paste the original text on one side and the changed text on the other.
  2. Added and removed lines are highlighted.
  3. Review the changes line by line.

Worked examples

Input: Original: a, b, c. Changed: a, c, d.

Result: Line b is shown as removed and line d as added. Lines a and c are unchanged.

Background

The comparison finds the longest common subsequence of lines, the longest run of lines that appear in the same order in both texts. Lines outside it are marked removed or added. Git and other diff tools rely on the same idea.

The comparison is line-based, so changing one word marks the whole line as changed. Differences in trailing whitespace or line endings also show up as changes.

Common mistakes

  • Missing changes that are only whitespace.
  • Comparing text with different line endings and seeing every line differ.
  • Reading a moved block as a delete plus an add.

Frequently Asked Questions

Does this compare character by character or line by line?
Line by line. Each line of the original and changed text is treated as a unit; if even one character within a line differs, the whole line shows as removed from the original and added in the changed version, rather than highlighting the specific characters that changed.
Why doesn't inserting one line in the middle mark everything after it as changed?
The comparison uses a longest-common-subsequence algorithm, which finds the longest run of lines shared between both texts regardless of a single insertion or deletion — so it aligns the matching lines before and after the edit rather than comparing purely by line position.
What do the plus and minus markers mean?
A line prefixed with + appears in the "Changed" text but not in the "Original"; a line prefixed with - appears in "Original" but was removed in "Changed." Lines with no prefix are identical in both and unchanged.
Does line order matter for what counts as a match?
Yes — matching lines must appear in the same relative order in both texts to be counted as part of the common subsequence. An identical line that got moved to a very different position may show up as both a removal and an addition rather than as unchanged.

Fast, local-first developer micro-tools with zero tracking or latency.

Browse All Tools
Local-First Architecture: Toolium parses payloads exclusively in browser memory. Zero network telemetry.
⌘C Copy⌘K Palette