Diff Checker & Text Compare

Compare two texts and find every difference instantly. View added, removed, and unchanged lines with character-level highlights. Switch between unified and side-by-side views, ignore whitespace or case changes, and copy the diff output. Free, runs entirely in your browser -- no data ever leaves your machine.

Original Paste or type original text
Modified Paste or type modified text
Diff Output
Enter text in both panels and click Compare to see differences.

Features

Line-by-Line Diff

Compare text line by line with added lines highlighted in green and removed lines in red. Unchanged lines are shown for context so you always know where changes occur.

🔍

Character-Level Highlights

Enable inline diff to see exactly which characters within a line were changed. Small edits in long lines become immediately visible without scanning the entire line.

Multiple View Modes

Switch between unified diff (single column with +/- prefixes) and side-by-side view (original and modified text aligned horizontally) to suit your review style.

🔒

100% Client-Side

All processing happens in your browser. No text is ever sent to any server, making it safe for comparing sensitive code, configs, credentials, or proprietary content.

About Text Diffing

Comparing text is one of the most fundamental operations in software development. Whether you are reviewing a pull request, auditing a configuration change, verifying a database migration, or proofreading a document revision, knowing exactly what changed between two versions is essential. A diff checker automates this process by computing the optimal set of changes that transform one text into another.

How This Tool Works

This diff checker uses a Longest Common Subsequence (LCS) algorithm to find the optimal alignment between the lines of your original and modified texts. Lines present in the original but not in the modified text are marked as removed (red). Lines present in the modified text but not in the original are marked as added (green). Lines that appear in both are shown as unchanged. When inline diff is enabled, changed line pairs are further analyzed with a character-level LCS to highlight exactly which characters differ.

Common Use Cases

Frequently Asked Questions

What is a diff checker?
A diff checker (also called a text compare tool or diff tool) compares two blocks of text and identifies the differences between them. It highlights which lines have been added, removed, or remain unchanged. Diff tools are essential in software development for code review, configuration management, document editing, and data validation. The concept originates from the Unix diff command, which has been a core developer tool since the 1970s. Modern diff tools add features like syntax highlighting, character-level diffs, and multiple view modes.
What is the difference between unified and side-by-side diff?
Unified diff displays all changes in a single column. Removed lines are prefixed with a minus sign (-) and shown in red, while added lines are prefixed with a plus sign (+) and shown in green. Unchanged lines provide context. This format is compact and is the standard format used by Git, patches, and most code review tools. Side-by-side diff shows the original text in a left panel and the modified text in a right panel, with corresponding lines aligned horizontally. This format is easier to visually compare specific sections but requires more screen width. Choose unified for compact review and side-by-side for visual clarity.
What does "ignore whitespace" do?
The "ignore whitespace" option normalizes whitespace before comparing. Multiple consecutive spaces and tabs are collapsed to a single space, and leading and trailing whitespace on each line is removed. This is useful when comparing code with different indentation styles (tabs vs. spaces, 2-space vs. 4-space indent), or when whitespace differences are not meaningful to your review. The option is equivalent to the -w flag in the Unix diff command. Note that completely blank lines are still compared normally.
What is an inline (character-level) diff?
An inline diff (also called a character-level or word-level diff) provides finer granularity than a line-level diff. When a line is modified rather than fully replaced, the inline diff highlights only the specific characters that changed. For example, if a line changes from port: 3000 to port: 8080, the inline diff will highlight just 3000 and 8080 rather than marking the entire line as changed. This makes it significantly easier to spot small edits in long lines of code or configuration files. Enable it with the "Inline diff" checkbox.
How does the LCS diff algorithm work?
The Longest Common Subsequence (LCS) algorithm finds the longest sequence of lines that appear in both texts in the same order, though not necessarily consecutively. By identifying this common subsequence, the algorithm determines the minimum set of additions and removals needed to transform one text into the other. Lines in the LCS are "unchanged," lines in the original but not in the LCS are "removed," and lines in the modified text but not in the LCS are "added." This produces an optimal, human-readable diff. The algorithm uses dynamic programming with O(m*n) time and space complexity, where m and n are the line counts of the two texts.
Can I compare code in any programming language?
Yes. This diff checker works with any plain text, regardless of programming language or file format. You can compare JavaScript, Python, Java, Go, Rust, C++, Ruby, PHP, SQL, HTML, CSS, and any other language. It also works with configuration formats like YAML, JSON, TOML, INI, and XML, as well as plain text documents, Markdown, CSV data, log files, and shell scripts. Simply paste the two versions you want to compare and click Compare.
Is my data safe?
Absolutely. This tool runs entirely in your browser using client-side JavaScript. No data you paste or type is ever transmitted to any server, stored in any database, or logged anywhere. The diff computation happens locally on your device. This makes it safe to compare sensitive source code, configuration files containing secrets, proprietary business documents, or any other confidential text. You can verify this by inspecting the network tab in your browser's developer tools while using the tool.

Explore More Developer Tools

Check out our other free developer tools. Format JSON, parse AWS ARNs, decode JWTs, and more -- all from your browser with no sign-up required.

JSON Formatter → K8s YAML Generator →