Diff Checker: Compare Text and Code
Paste an original and a changed version, or drop two files, to see exactly what differs. Switch between a side by side and a unified view, drill from line level down to the exact words and characters that changed, ignore whitespace or case, collapse the unchanged parts, and export a standard .diff file. Everything runs in your browser, so nothing you compare is ever uploaded.
How to compare two texts
- Paste or drop the original on the left and the changed version on the right.
- Pick a mode (Line, Word or Character) and a view (side by side or unified).
- Read the highlighted differences, then copy or download the diff.
Examples
A reworded line
return 'Hi ' + name; vs return `Hello, ${name}!`;One modified line, with only the changed words highlighted on each side.
An added line
one two
one two + three
Frequently asked questions
What does a diff show?
It shows how two texts differ. Lines only in the original are marked as removed, lines only in the changed version are marked as added, lines that were edited are shown as modified with the exact changed words highlighted, and matching lines are shown as unchanged.
Can it highlight word and character changes, not just whole lines?
Yes. In Line mode, an edited line shows only the changed words highlighted on each side. You can also switch to Word or Character mode to compare the whole text at that granularity, which is ideal for prose and for spotting a single changed digit or letter.
What is the difference between side by side and unified?
Side by side shows the original and changed text in two aligned columns, which is great for reviewing edits. Unified stacks them into one column with - and + markers, the same format used by patches and code review tools, and is what the .diff export uses.
Can I ignore whitespace or case?
Yes. Turn on Ignore whitespace to treat lines that differ only in spacing or indentation as equal, and Ignore case to treat differences in capitalization as equal. The original text is always shown as you pasted it, the options only affect matching.
Is my text private?
Yes. The comparison runs entirely in your browser. Nothing you paste or drop is uploaded or stored on a server, so it is safe for private code, contracts and documents.
How does it decide which lines match?
It uses a longest common subsequence algorithm to find the largest set of lines that appear in both versions in order, then reports everything else as added, removed or modified. That keeps one edit from cascading into a wall of false changes. Windows and Mac line endings are normalized first.
Related tools
Semantic Diff
Diff two texts by meaning, not characters. AI matches reworded or reordered ideas a line diff misses, then groups common, removed and added. Nothing uploaded.
Text Diff
Compare two blocks of text and see the differences line by line. A clear LCS diff highlights added, removed and unchanged lines. Free and private.
JSON Formatter
Format, validate and minify JSON online. Pretty-print with custom indentation, sort keys and catch syntax errors. Runs in your browser.
.env to JSON
Convert a .env file to JSON, or JSON back to .env. Parses KEY=value lines, comments, quotes and export. Runs entirely in your browser.
ASCII Table
Full ASCII table for all 128 codes with decimal, hex, octal and binary values, character names and descriptions. Search by code, hex or character.
Aspect Ratio Box Generator
Generate CSS for a responsive aspect-ratio container. Use the modern aspect-ratio property or the padding-top fallback, then copy the ready code.