Skip to main content
DevBench
±

Text Diff

TextOffline-ready

Text Diff compares two blocks of text and highlights every addition and deletion using the Myers diff algorithm — the same algorithm Git uses. Paste the original text on the left and the updated text on the right, and changes appear instantly with added lines in green and deleted lines in red. Toggle whitespace-only changes, switch between side-by-side and unified views, and copy the diff output as a standard patch.

Related: JSON DiffRegexFindXML

How to use the Text Diff tool

  1. Paste the original text into the left panel and the updated text into the right panel.
  2. Added lines are highlighted in green, deleted lines in red — changed lines show both versions.
  3. Toggle Ignore whitespace to hide formatting-only changes and focus on content differences.
  4. Toggle Side-by-side / Unified to switch between a split view and a single-column diff.
  5. Click Copy diff to copy the unified diff output for use in a patch file or bug report.

What is a text diff?

A text diff shows exactly what changed between two versions of a text. Lines added are highlighted in green, deleted lines in red, and unchanged context lines are shown in between. This is the same underlying technique used by Git to show commit changes and by code review tools like GitHub Pull Requests.

Diff algorithms: how it works

This tool uses the Myers diff algorithm — the same algorithm used by Git. It finds the shortest edit script (minimum number of insertions and deletions) to transform text A into text B. For JSON comparison, use the JSON Diff tool which understands JSON structure rather than treating it as plain text.

Common use cases