Diff Checker
Compare two texts and highlight added, removed, and changed lines.
How to Use the Diff Checker
- Paste your original text in the left box and the modified text in the right box.
- Click Compare to see the differences highlighted below.
- Green lines are added, red lines are removed, and plain lines are unchanged.
- Click Load Sample to see an example comparison.
What is a Diff Checker?
A diff checker is a text comparison tool that highlights the differences between two versions of a text. It shows which lines were added (in green), which were removed (in red), and which are unchanged. "Diff" comes from the Unix diff command, a tool for computing the differences between files. This online version works entirely in your browser — your text is never uploaded anywhere.
Common Use Cases
- Code review: Quickly spot what changed between two versions of a code snippet
- Document version comparison: Compare drafts to find what was added, removed, or reworded
- Config file differences: Identify changes between two configuration files or environment settings
- Proofreading: Compare an original text to an edited version to review all changes at once
- API response debugging: Compare two JSON or API responses to spot unexpected changes
FAQ
What is a diff?
A diff is the result of comparing two texts to find their differences. The output typically marks added lines with a + symbol (shown in green) and removed lines with a − symbol (shown in red). Unchanged lines provide context around the changes. The term comes from the Unix diff command, created in the early 1970s.
What is unified vs split diff?
A unified diff shows both versions of a file in a single column, with + for added lines and − for removed lines. A split diff (side-by-side) shows the original on the left and the modified version on the right, making it easier to compare lines visually. This tool uses a unified linear format, which is clear for text comparisons.
Can I compare JSON with the diff checker?
Yes. Paste two JSON strings to compare them line by line. For a more structured JSON comparison — accounting for key ordering and nested differences — use a dedicated JSON diff tool. The text diff checker works best when the structure of both inputs is similar.
How does the comparison work?
The tool uses the Longest Common Subsequence (LCS) algorithm, the same algorithm used by the Unix diff command and Git. It finds the largest set of lines that appear in both texts in the same order, then marks everything else as added or removed. This produces the minimal edit distance between the two texts.
Is my text stored anywhere?
No. All comparison processing happens entirely in your browser using JavaScript. Your text is never sent to any server or stored anywhere. You can safely compare confidential code, passwords, or private documents.