How it works
- Paste or open the original and the changed text.
- Choose side by side or unified view and the comparison options.
- Read the highlighted changes, and copy or save the diff.
Why use it
- Line and word level highlighting.
- Ignore whitespace or case.
- Side by side and unified views.
- Handles large files without a server.
Comparing two texts: reading a diff and its options
How the comparison works
The checker first lines the two texts up line by line, finding the longest stretches they share and marking what was added, removed or changed between them. This is the same kind of comparison version control systems such as Git use. Inside each changed line, it then compares word by word, so a single edited number in a long line is highlighted on its own instead of the whole line turning red.
Removed lines are shown on the original side, added lines on the modified side, and changed lines on both, with the exact words that differ marked. The count of changes and buttons to jump to the next and previous one make long files easy to review.
Side by side or unified
- Side by side puts the original and the modified text in two columns with matching lines aligned. Best on a wide screen and for prose, contracts and configuration.
- Unified shows one column, removed lines followed by added lines, the way Git and code review tools show changes. Best on a phone or for code.
- Only show changes hides the unchanged stretches between changes, keeping a few lines around each for context.
Pick the Syntax of the texts, JavaScript or TypeScript, JSON, YAML, XML, HTML, CSS, Markdown or plain text, and both sides are coloured like a code editor, which makes changes in code much easier to read. Long texts can also be opened straight from files on either side.
The ignore options
Not every difference matters. Ignore trailing spaces, on by default, skips invisible spaces at the end of lines, which editors add and remove without anyone noticing. Ignore whitespace goes further and treats lines as equal when they differ only in spaces and indentation, which is what you want after code was re-indented. Ignore case treats capital and small letters as the same, useful for lists of names or keywords.
Good uses
- Contracts and documents: paste two versions to see exactly what the other side changed, word by word.
- Configuration files: find the one setting that differs between a working and a broken server.
- JSON from two API responses: format both first with the JSON formatter and Sort keys, so only real differences remain.
- Lists: spot names added to or missing from a list exported twice.
Everything stays in your browser, which matters here: the texts people compare are often contracts, configuration with passwords, and private data.
If something goes wrong
- Every line is marked as changed. The files use different line endings or indentation. Switch on Ignore whitespace.
- Two files look identical but are not. The difference is invisible characters, such as a non breaking space or a different quote mark. The word highlight shows where.
- A moved paragraph shows as removed and added. Line comparisons do not track moves; that is expected.
Questions and answers
How do I compare two files online?
Open or paste each file into its side, and the differences appear immediately.
Can I ignore whitespace differences?
Yes. Turn on the ignore whitespace option to hide changes that are only spacing.
Are my texts stored?
No. Comparison runs locally and nothing is uploaded or saved.