Text Diff Checker

Compare two texts and see exactly what changed. Nothing is uploaded.

How to Compare Two Texts

A diff checker shows the differences between two versions of the same text. To use this one:

  1. Paste the original text in the left box and the changed text in the right box.
  2. Read the result below. Removed lines are red on the left, added lines are green on the right, and unchanged lines are left plain.
  3. Look at the highlighted words. When a line was edited rather than replaced, only the words that changed are marked, so a one-word edit in a long line is easy to spot.
  4. Adjust the options to ignore whitespace or case, or to hide everything except the changes and a few lines of context.

The comparison happens in your browser as you type. Your text is never sent to a server.

What Is a Diff?

A diff is the list of edits that turn one text into another. Version control tools such as Git use diffs to show what changed in a commit, and code review tools use them to show what a pull request touches. The classic approach finds the longest common subsequence (LCS) of lines: the biggest set of lines that appear in both texts in the same order. Everything else is either a deletion or an insertion.

This tool works the same way, then goes one step further. Where a deleted line and an inserted line sit side by side, it compares them word by word and highlights just the differing words.

Common Uses for a Text Comparison Tool

  • Code and configuration: compare two versions of a script, a .env file, a YAML manifest or a SQL query when you do not have them in a repository.
  • Documents and contracts: see what a colleague or counterparty changed between drafts, without a word processor's tracked changes.
  • API responses and logs: check what differs between a response from staging and one from production. For JSON, run both through the JSON Formatter first so that layout differences do not hide the real ones.
  • Copy checking: confirm that text you retyped or translated matches the source, or find where two near-duplicate pages diverge.

Tips for Cleaner Results

If almost every line shows as changed, the cause is usually invisible: different indentation, tabs versus spaces, or Windows and Unix line endings. Line endings are normalised automatically, and the Ignore whitespace option handles the indentation. Ignore case is useful when comparing identifiers or text that was retyped in a different capitalisation.

Frequently Asked Questions

How does the text diff checker work?

It splits both texts into lines and finds the longest common subsequence of lines, meaning the largest set of lines that appear in the same order in both texts. Lines outside that set are shown as removed from the original or added in the changed version. When a removed line and an added line sit next to each other, the tool also compares them word by word and highlights only the words that changed.

Is my text uploaded to a server?

No. The comparison runs entirely in your browser with JavaScript. Neither text is uploaded, stored or logged, so it is safe to compare private code, contracts or configuration files. You can confirm this by disconnecting from the internet: the tool keeps working.

Can I ignore whitespace or letter case?

Yes. Tick Ignore whitespace to treat runs of spaces and tabs as equal and to disregard leading and trailing spaces, which is useful when code was re-indented. Tick Ignore case to treat upper and lower case letters as the same. The result updates immediately.

Is there a size limit?

Identical lines at the start and end of both texts are skipped first, so large files that differ only in a few places compare instantly. The remaining differing block can be up to about 25 million line pairs, for example two completely different texts of roughly 5,000 lines each. Beyond that the tool asks you to compare smaller sections.

Can I compare JSON, code or configuration files?

Yes, any plain text works: source code, JSON, YAML, CSV, logs, contracts or prose. For JSON, format both documents with the same indentation first so that formatting differences do not hide the real changes.