Diff Checker

Free diff checker and text compare tool: paste or upload two versions to compare text online and see every line, word and character that changed, side by side or inline. Nothing you paste is uploaded — everything runs in your browser.

Paste or type text on both sides. Short texts are compared as you type; press Compare (or Ctrl/Cmd+Enter) for large ones.

Runs entirely in your browser (a Web Worker does the comparing off the main thread): neither text is uploaded, logged or saved.

How to compare two texts

  1. Paste the original text on the left and the changed version on the right, or press Upload above either box to open a file. Sample loads the example below.
  2. Short texts are compared as you type. The chips above the result show how many lines were added, removed and changed.
  3. Choose Side by side or Inline, and use ↑ Prev / ↓ Next to jump between changes.
  4. Tick Ignore whitespace, Ignore case, Ignore blank lines or Trim trailing spaces to stop cosmetic differences from being reported as changes.
  5. Press Copy patch or Download .diff for a standard unified diff, or Swap sides to compare in the other direction.

Diff checker example

Version 1.2.0 of a changelog:

FreeToolHQ Release Notes
=========================

Version 1.2.0 (March 2024)
- Added dark mode toggle
- Fixed a bug in the CSV export
- Improved page load time

Thanks for using our tools!

Version 1.3.0: one line was changed, a bullet was added, and the release date and closing line were both edited:

FreeToolHQ Release Notes
=========================

Version 1.3.0 (April 2024)
- Added dark mode toggle
- Fixed a bug in the CSV and JSON export
- Improved page load time
- Added a JSON compare tool

Thanks so much for using our tools!

Comparing them finds 3 changed lines and 1 added line. Character-level highlighting shows exactly which words moved inside a changed line, for example:

- Fixed a bug in the CSV export

- Fixed a bug in the CSV and JSON export

Only "and JSON " was inserted — the rest of the line is unchanged, which a plain line-by-line diff can't show you.

Side-by-side vs. inline (unified) diff view

Side by side lines up the original and changed text in two columns, which is easiest for reviewing a document on a wide screen. Inline (also called unified) shows removed lines marked - directly above the added lines marked + that replaced them, in the same format as git diff and .diff patch files — more compact, and familiar if you read patches or pull requests. Both use the same underlying comparison; switching views doesn't change what counts as a difference.

Ignoring whitespace, case and blank lines

Reformatting a file, changing indentation, or re-saving with a different line ending can make every line look different even when the content is the same. Comparing const x = 1; with const x = 1; reports 1 changed line by default, because the amount of whitespace is different:

With Ignore whitespace ticked, every space and tab is ignored (the same as the Unix diff -w flag), and the two lines compare as identical. Ignore case does the same for capitalisation, Trim trailing spaces ignores only whitespace at the end of a line, and Ignore blank lines skips empty lines on both sides — useful when one version has extra blank lines between paragraphs. Windows (CRLF) and Unix (LF) line endings are always treated as equal, so switching operating systems never shows as a difference.

Unified diff patches, and comparing code

Press Copy patch or Download .diff to get the comparison as a standard unified diff — the same plain-text format git diff, svn diff and the patch command produce and understand. It's useful for code reviews, bug reports, and applying a change to a file with git apply or patch, without either version ever leaving your browser to generate it.

Handles large files without freezing the page

Pasting a 10,000-line log file or a large generated file shouldn't lock up the tab. Short texts are compared as you type; large ones (roughly 150,000 characters combined) wait for you to press Compare or Ctrl/Cmd+Enter, so one keystroke never queues an expensive comparison. Either way, the comparison itself runs in a background Web Worker rather than on the page's main thread, and long stretches of unchanged lines are collapsed with a "show more" button so the page renders the handful of lines that actually changed instead of every line in the file.

Diff checker vs. JSON compare

This diff checker compares text line by line: it's the right tool for prose, config files, logs, source code and anything else read top to bottom. JSON is different — {"a":1,"b":2} and {"b":2,"a":1} are the same data with keys in a different order, but a line-by-line diff would flag the whole file as changed. For JSON specifically, use the JSON compare tool: it parses both documents and compares the data itself, ignores key order, and reports each difference by path instead of by line. Use whichever matches what you're comparing — this page for text, JSON compare for JSON.

More developer tools

Frequently asked questions

What does a diff checker do?

It compares two pieces of text — two drafts of a document, two versions of a config file, two API responses, or old and new source code — and shows exactly what changed: which lines were added, removed or changed, and which words or characters inside a changed line are different. It saves you from reading both versions side by side line by line looking for the difference yourself.

Is my text uploaded anywhere?

No. Both texts are compared by JavaScript running in your own browser, and the comparison itself runs in a Web Worker so the page never freezes. Nothing you paste or upload is sent to a server, logged or saved. Only your options (ignore whitespace, view, and so on) are remembered on your device, never the text itself.

How do I compare two files instead of pasting text?

Press Upload above either box to open a .txt, .md, .csv, .log or other plain-text file from your device; its contents are read locally and never leave your browser. There is no server-side upload, so there is no file size limit beyond what your browser can hold in memory.

What's the difference between side-by-side and inline (unified) diff?

Side by side shows the original and changed text in two columns, lined up row by row, which is easiest for scanning a document. Inline (also called unified) shows one column with removed lines marked "-" and added lines marked "+", which is the format used by git diff and patch files, and is more compact for long files viewed on a narrow screen. Switch between them with the buttons above the result; both use the same comparison underneath.

How do I ignore whitespace-only or case-only changes?

Tick Ignore whitespace to treat "const x = 1;" and "const x = 1;" as identical (every space and tab is ignored, the same as diff -w), Ignore case to treat Hello and hello as the same word, Trim trailing spaces to ignore only whitespace at the end of a line, and Ignore blank lines to skip empty lines on both sides. Each option only changes what counts as a difference — both texts are still shown exactly as you typed them.

Can it compare code, like a git diff?

Yes. Paste the old and new version of a file (or two commits’ contents) into the two boxes. The result is the same kind of line-by-line diff git diff shows, with word and character-level highlights inside changed lines that plain git diff doesn’t give you, and you can copy or download the result as a standard unified .diff patch.

What is a unified diff (.diff patch), and how do I use it?

A unified diff (or patch) is a plain-text format that lists only the lines that changed, with a few lines of context, prefixed with - for removed and + for added. It's what git diff, svn diff and the patch command all produce and understand. Press Copy patch or Download .diff to get one for the two texts you're comparing; it can be applied with git apply or patch, attached to a code review, or pasted into a bug report.

Can it handle very large files without freezing the page?

Yes. Short texts are compared as you type; once both sides together pass about 150,000 characters, typing pauses the automatic comparison and you press Compare (or Ctrl/Cmd+Enter) instead, so a single keystroke never queues an expensive diff. The comparison itself always runs in a Web Worker, off the page’s main thread, and long runs of unchanged lines are collapsed with a "show more" button so a 10,000-line file with a handful of edits renders quickly instead of as ten thousand rows.

What's the difference between this and a JSON diff checker?

This tool compares text line by line, so reformatting a JSON file or reordering its keys shows up as a change even when the data is identical. The JSON compare tool parses both sides first and compares the data itself: it ignores key order and whitespace, and reports differences by path (like $.address.zip) instead of by line number. Use this page for text, config files, logs, essays and code; use JSON compare for JSON specifically.

Does it compare Word documents, PDFs or images?

No, only plain text. If you have a Word document or PDF, copy its text out (or export it as .txt) and paste that in; formatting, images and page layout aren't compared. For structured JSON files, the JSON compare tool above is a better fit than a line-based text diff.

This tool compares text in your browser. It matches lines and highlights word and character-level changes heuristically, like git diff; for exact byte-for-byte verification of critical files, use a checksum. Spotted a wrong result? Tell us. Last reviewed .