DevToolCase
Sign in Sign in

Compare two texts

See the lines removed and added between two texts, the changed words highlighted, and copy the differences as a unified diff.

Share this result

Encrypted in your browser. The key stays in the link, after “#”: only the people you give it to can read it, not even DevToolCase.

The link works for

Sign in for longer links or links without expiry, and to find them in your account.

Runs entirely in your browser: nothing you type is sent or stored.

Comparing two texts

Paste or open two versions of a text, a configuration file, a SQL query or an API response: the lines removed are shown in red, the lines added in green, and in a modified line the words that changed are highlighted.

The comparison finds the fewest lines to remove and add to go from one text to the other, with the same algorithm as git diff (Myers).

Options

  • Ignore spaces: lines differing only by indentation, trailing spaces or several spaces in a row count as equal; handy after a reformatting.
  • Ignore case: SELECT and select count as equal.
  • Changes only: long runs of unchanged lines are folded, three lines of context being kept around each change.

Unified diff

“Copy the diff” gives the differences in the unified format of git diff and diff -u, with lines starting with - and +, grouped in blocks headed by @@ -12,7 +12,8 @@. Paste it in a code review, a ticket or a message; git apply or patch can apply it.

Comparing data

Two JSON documents with keys in a different order differ on every line. Format both with sorted keys in the JSON formatter first: only the real differences remain.

Add this browser’s favorites to your account?

This browser has 0 favorites that your account does not have:

Either way, this browser keeps its favorites: you find them again after signing out.