Free Online Diff Checker – Compare Text, Code and JSON Side by Side | TrenTyx

trentyx@local:~/dev-utilities/diff-checker $ run diff-checker_

Paste two versions of a file, a config block or a chunk of prose and see exactly what changed. Line, word and character level comparison, side-by-side or unified view, and a real unified .patch file you can feed to git apply. Nothing leaves your browser.

original 0 lines
modified 0 lines
Compare By
View
Ignore
Comparing line by line. Changed lines are paired up and the differing words inside them are highlighted.
0
lines added
0
lines removed
0
lines unchanged
100%
similarity
diff no comparison yet
Paste text into both panels to see the difference.
added removed changed

How This Diff Checker Works

A diff is the shortest description of how to turn one text into another. This tool computes one using a longest common subsequence algorithm: it strips the identical head and tail of both inputs, then finds the largest set of lines that appear in the same order in both versions. Everything outside that set is reported as an addition or a deletion. For very large inputs it switches to an anchor-based strategy — lines that appear exactly once in both texts become fixed points, and the gaps between them are compared separately — which keeps big files fast without wrecking the quality of the result.

When a removal and an addition line up, the two lines are compared again at word level so you can see the exact token that changed instead of a whole line painted red and green. That is usually the difference between spotting a flipped boolean in two seconds and reading the same line four times.

Line, Word or Character?

  • Line — the right default for source code, configuration and logs. It matches what git diff shows you.
  • Word — best for prose, documentation and translated copy, where a reflowed paragraph would otherwise look completely rewritten.
  • Character — for short strings, IDs, hashes and minified content, where a single wrong character is the whole story.

Common Use Cases

  • Reviewing a change before you commit — paste the old and new file and read the diff without leaving the browser.
  • Comparing two API responses — find the field that changed between a working and a failing call.
  • Checking config drift — compare staging and production environment files line by line.
  • Proofreading edited copy — word mode shows exactly which sentences an editor or an AI model rewrote.
  • Producing a patch — export a standard unified diff and apply it with git apply or patch -p0.

Frequently Asked Questions

Is my text uploaded to a server?

No. The comparison runs in JavaScript inside your tab, so confidential source code, contracts and API payloads never leave the machine. You can disconnect from the internet and the tool still works.

How large a file can it handle?

Tens of thousands of lines are fine. Below roughly four million line-pairs the tool uses the exact algorithm; above that it falls back to anchor-based splitting, which is a little coarser in dense rewrites but keeps the page responsive instead of freezing it.

What do the ignore options do?

They change how two lines are compared, not how they are displayed. Letter case makes the comparison case-insensitive, whitespace ignores indentation and spacing differences, and blank lines drops empty lines entirely — useful when only formatting changed.

Can I use the downloaded file as a real patch?

Yes. The export is a standard unified diff with @@ hunk headers and three lines of context, using original and modified as filenames. Rename those headers to the real paths if you plan to apply it inside a repository.

Why do results differ slightly from git diff?

Git applies extra heuristics, such as shifting hunk boundaries to the most readable position and detecting moved blocks. The change set is equivalent, but the grouping of lines can look different.

Related Tools