Skip to content
dz / text-diff
Text

Text diff

Compare two texts side by side or inline – config files, JSON, code. Changes down to the word.

/diff
Original
Changed

Differences

Compared in your browser – the texts are never uploaded.

▸ About this tool

About the Text Diff Checker

Introduction

A diff shows what changed between two versions of a text: which lines were removed, which were added and which stayed the same. It is how developers review code, how operators check what an update did to a configuration file, and the quickest way to spot the one changed value in two long API responses. This tool compares any two texts directly in the browser – no Git repository, command line or upload needed.

How to use it

  1. Paste the original text on the left and the changed text on the right, or drop a file onto either side. The comparison updates as you type.

  2. Choose Side by side to read both versions in parallel or Inline for a compact, Git-style view with − and + lines. Inside a changed line, the exact words that differ are highlighted.

  3. Jump between changes with Prev / Next or the keys j and k. Long stretches of unchanged lines are folded away; click a fold or Expand all to see them.

  4. Patch copies the result as a unified diff – the format of git diff and diff -u – ready to paste into a ticket, a code review or git apply.

Short links: develzone.org/diff, /compare and /jsondiff (starts with JSON normalisation switched on).

Options that remove noise

  • Ignore whitespace treats lines as equal when they differ only in spaces or tabs, and ignores blank lines that were added or removed – re-indented code or a config file that switched from tabs to spaces no longer shows as completely changed, and inside a changed line only the words are highlighted, not the spacing. It works like git diff -w --ignore-blank-lines.

  • Ignore case is useful for SQL, HTML or headers where capitalisation does not matter.

  • JSON: normalise & sort keys pretty-prints both sides with alphabetically sorted keys before comparing. Two API responses with the same data but different key order or formatting then show as identical, and real changes stand out. Numbers are compared exactly as written, without rounding.

Typical uses

  • Review what a package update or a colleague changed in nginx.conf, .env, docker-compose.yml or Kubernetes manifests.

  • Compare API responses from staging and production, or before and after a deployment.

  • Check two versions of a SQL query, a translation file or a contract text.

  • Find the one line that differs between two log excerpts or CSV exports.

Privacy

Both texts are compared entirely in your browser and are never uploaded or stored. That makes it safe for configuration files with internal host names, environment files and confidential documents.

How it works

The comparison uses the Myers diff algorithm (Eugene W. Myers, 1986) – the same algorithm behind GNU diff and Git. It finds the smallest set of line insertions and deletions that turns one text into the other. Changed lines are then compared word by word to highlight the exact edit. The first Unix diff was written by Douglas McIlroy and James Hunt in 1974; the unified format with @@ hunk headers that the Patch button produces became the standard in the 1990s.

Comparing JSON? Format or validate it first with the JSON formatter.

❯ Esc
↑ ↓ select ↵ open Shift ↵ new line