Diff Checker | Compare Text & Highlight Differences Free
Compare two texts side-by-side and highlight the differences instantly. Perfect for code, JSON, and documents.
How the Diff Checker Compares Two Texts
The Diff Checker takes two blocks of text, an original and a changed version, and marks exactly what was added, removed, or left untouched between them. Paste both versions directly or upload files, and the tool lines up the content and highlights every difference in place.
How the comparison works
The tool uses a longest common subsequence algorithm: it finds the longest run of matching pieces shared by both texts, then marks everything outside that run as inserted or deleted. The comparison can run at three levels of detail: character by character, word by word, or line by line. Line mode is best for spotting which whole lines changed in a document; word mode fits a reworded sentence; character mode catches a single typo fix. Results appear as two side by side columns (split view) or merged into one continuous passage with inline markup (unified view). Added text is underlined in green, removed text is struck through in red, and a running count of added and removed characters sits above the result. Files can also be uploaded directly, in .txt, .json, .js, .ts, .css, .html, .md, .yaml, or .xml format, and compared the same way as pasted text.
Example: a reworded sentence
Original: "The quarterly report was late." Changed: "The quarterly report was late again." In word mode, only "again" is marked as added, since every other word in the sentence matches. Switch to character mode on the same pair and the tool instead marks the space and the letters in "again" as an insertion at the character level, since that is the smallest unit being compared there.
Example: comparing a JSON snippet
Uploading or pasting two versions of a config file works the same way. Original file:
{
"port": 3000,
"debug": true
}
Changed file:
{
"port": 8080,
"debug": true,
"timeout": 30
}
In line mode, the port line is marked as changed because 3000 became 8080, the debug line is marked as changed too since it now ends in a comma to make room for the next field, and the new "timeout": 30 line is marked as added. Only the opening and closing braces stay plain. The comparison treats both files as plain text rather than parsed JSON, so reordering the same two keys without changing any value would still show up as a change.