Free Text Diff Checker

Paste the original text on the left and the changed version on the right, then click Compare to see every added and removed line highlighted. Works for code, configs, SQL, JSON, prose — any line-based text. Everything runs in your browser; nothing is uploaded.

Examples
No result yet — press Compare.

About this Text Diff Checker

"What changed?" is one of the most common questions in software work — between two config files, two API responses, two deploy manifests, two drafts of a document. This free Text Diff Checker answers it instantly: paste both versions and it highlights every line that was added (green, prefixed with +) or removed (red, prefixed with −), with unchanged lines shown in place so you keep the surrounding context.

The comparison runs entirely in your browser using a classic LCS (longest common subsequence) line diff — the same family of algorithm behind git diff and most code review tools. There is no API call, no upload, and no storage, which makes it safe to compare configs and internal files without them ever leaving your machine.

How line diffing works

A line diff treats each text as a sequence of lines and finds the longest subsequence of lines the two texts have in common. Everything in that common subsequence is "same"; lines in the original that fall outside it are "removed", and lines in the changed text outside it are "added". A few consequences worth knowing:

  • A modified line shows as remove + add. Line diffs have no concept of "edited in place" — changing one character on a line produces a red removed line followed by a green added line.
  • Whitespace counts. Two lines that differ only by a trailing space are different lines. Enable Ignore trailing whitespace above to filter out that noise (common when editors auto-strip whitespace on save).
  • Moved blocks show as remove + add. If a block of lines moves from the top of a file to the bottom, a line diff reports it as removed in one place and added in another — it does not track movement.

If you want to understand the algorithm itself, our post on how diff algorithms work (LCS explained) walks through the dynamic-programming table step by step.

Common uses for a diff checker

  • Config drift — compare the config running in staging against the one in production to find the setting that explains a behavioral difference.
  • Before/after refactors — sanity-check that a generated file, SQL export, or build artifact changed only where you expected.
  • API responses — paste two JSON or XML responses to spot the field that appeared, disappeared, or changed. (For structure-aware JSON comparison, see comparing two JSON objects — pretty-printing both sides with our JSON Formatter first makes line diffs much more useful.)
  • Documents and prose — compare two drafts of a README, policy, or email to see exactly which sentences changed.
  • Log excerpts — diff a healthy request log against a failing one to find the first line where the paths diverge.

Reading the output

The result is a unified view: lines flow in order, with removals shown where they used to be and additions where they now are. The summary line above the diff counts added and removed lines. This is the same mental model as git diff output — if you are new to reading diffs, our beginner guide to git diff explains hunks, prefixes, and context lines in more depth.

Limits

Each side is capped at 5,000 lines. The LCS algorithm builds a table proportional to the product of the two line counts, so unbounded inputs could lock up the browser tab. Within the limit, comparisons are effectively instant. For multi-megabyte files, a local tool (git diff --no-index a b, diff -u, or your editor's compare mode) is the right choice.

FAQ: Text Diff Checker

Is this Diff Checker free?
Yes — the Text Diff Checker on Dev Brains AI is completely free to use, with no signup required.
Is my text sent to a server?
No. The comparison runs entirely in your browser using a JavaScript implementation of the classic LCS (longest common subsequence) diff algorithm. Nothing you paste is uploaded, logged, or stored on our servers.
How does the diff algorithm work?
It compares the two texts line by line and computes the longest common subsequence of lines. Lines present in both texts are shown unchanged; lines only in the original are marked as removed, and lines only in the changed text are marked as added.
Is there a size limit?
Yes — each side is limited to 5,000 lines. The LCS algorithm compares every line of one text against every line of the other, so very large inputs would freeze the browser tab. For bigger files, use a local tool like git diff.
What does "ignore trailing whitespace" do?
When enabled, spaces and tabs at the end of each line are trimmed before comparing. This hides noisy differences caused by editors that strip (or add) trailing whitespace on save, so you only see meaningful changes.

More developer tools from Dev Brains AI

Comparing JSON? Pretty-print both sides first with the JSON Formatter so the diff lines up. To go deeper, read How Diff Algorithms Work: LCS Explained, Git Diff Explained for Beginners, and JSON Diff: Comparing Two JSON Objects.