PublicSoftTools

Diff Checker Online Free — Word & Character Level

Paste two blocks of text and instantly see every difference highlighted — by line, word, or individual character, including case changes and punctuation. No signup, runs entirely in your browser.

Original
Modified

Paste text into both panels above — the diff appears instantly.

How the Diff Checker Works

  1. 1Paste your original text into the left panel and the modified text into the right panel.
  2. 2The diff appears instantly beneath — green lines were added, red lines were removed, and white lines are unchanged.
  3. 3Use the Highlight toggle to switch between Line (whole-line color), Word (highlights changed words and punctuation), and Char (highlights individual characters, including case differences). Toggle Unified / Split view to suit your workflow.
  4. 4Click Copy diff to copy the result in standard unified diff format — compatible with patch and most code review tools.

What Is a Diff and Why Does It Matter?

A diff (short for difference) is a structured representation of what changed between two versions of a document. Software developers use diffs constantly — every Git commit shows a diff of what lines were added or removed. Writers use diffs to track revisions. Data engineers use them to spot unexpected changes in configuration or output files.

The Longest Common Subsequence algorithm this tool uses is the same method that powers the diff utility on Unix-like systems and Git’s line-level comparison. It finds the minimal set of changes needed to transform one text into the other, making the output as readable and meaningful as possible.

Tips for Getting the Most from the Diff Checker

Normalize line endings first

Windows uses CRLF line endings while Linux and macOS use LF. If your texts were created on different systems, paste them through a text editor first to normalize endings — otherwise every line may appear as changed.

Use split view for short diffs

Split view works best when you have a moderate number of changes and want to see the before and after of each block side by side. For long documents with sparse changes, unified view is faster to scan since it keeps everything in one column.

Compare formatted code

Run both code snippets through a formatter (like the JS Beautifier or SQL Formatter here) before diffing. This removes whitespace-only changes from the output so you see only meaningful differences.

Swap to double-check direction

The Swap button flips original and modified. Use it to confirm the diff reads the way you expect — that added and removed labels correspond to the right version of your document.

Copy diff for code reviews

The copied diff uses the standard unified format that GitHub, GitLab, and Jira all render as coloured diffs. Paste it directly into a PR description or issue comment for a readable inline comparison.

Check configuration files

Paste two versions of a config file (YAML, TOML, JSON, .env) to spot exactly which keys changed between environments. The line-level output makes it easy to see additions and removals without reading every line manually.

Frequently Asked Questions

How does the diff checker compare text?

The tool uses the Longest Common Subsequence (LCS) algorithm — the same core technique used by the Unix diff utility and Git. It builds a dynamic programming table to find the longest sequence of lines shared between the two inputs, then marks lines that appear only in the original as removed and lines that appear only in the modified version as added. The result is an accurate, minimal diff.

What is the difference between unified view and split view?

Unified view shows all lines in a single column: removed lines are highlighted in red and added lines in green, interleaved in the order they appear. It is compact and easier to scan for changes in a long document. Split view shows the original on the left and modified on the right, with corresponding changed lines aligned side by side — useful when you want to visually compare the before and after of each changed section simultaneously.

Is my text sent to a server?

No. The entire diff algorithm runs in JavaScript inside your browser. Nothing is transmitted to any server. You can disconnect from the internet after the page loads and the tool will continue to work. This makes it safe to use with confidential documents, source code, or any sensitive content.

Can I use this to compare code?

Yes. The diff checker works on any plain text — source code (JavaScript, Python, SQL, HTML, CSS, etc.), configuration files, prose, JSON, XML, CSV, or anything else you can paste. The output uses a monospace font to preserve indentation and spacing, making it easy to read code diffs.

What does the "Copy diff" button copy?

It copies a unified diff in the standard patch format: lines starting with "+" are additions, lines starting with "-" are removals, and lines starting with a space are unchanged. This format is compatible with the patch command-line utility and can be pasted into code review tools or issue trackers.

How does the Highlight toggle (Line / Word / Char) work?

The Highlight toggle controls the granularity of intra-line highlighting. Line mode colors the entire changed line red or green with no further detail — the same as standard git diff. Word mode runs a second LCS pass on each changed line pair, tokenizing by words and individual punctuation characters, then highlights only the specific words or punctuation that differ with a darker background. Char mode uses character-by-character LCS, which catches single-letter case changes (e.g. "Hello" vs "hello"), individual punctuation differences (comma vs period), and any spacing changes at the character level. Word mode is the recommended default for most comparisons.

Is there a size limit on how much text I can compare?

There is no hard limit enforced by the tool, but the LCS algorithm has O(m × n) time and memory complexity, where m and n are the number of lines. Very large inputs — tens of thousands of lines each — may take a second or two or cause the browser tab to use significant memory. For extremely large files, command-line tools like diff or git diff are better suited.

What does the stats bar show?

The stats bar shows three counts after you paste both texts: the number of lines added (shown in green), the number of lines removed (shown in red), and the number of unchanged lines. If the two texts are identical, it says so explicitly rather than showing zero counts for everything.