About the Text Compare tool
When two versions of a document look almost identical, spotting what changed by eye is slow and error-prone. This diff checker compares an original and a changed text and shows every difference: added lines in green, removed lines in red, and edited lines with the exact words or characters that changed highlighted inside them.
It uses the same kind of algorithm as git diff. The open-source jsdiff library finds the longest common sequence of lines, so inserting or deleting a line in the middle only marks that line; everything after it still lines up. Removed and added lines that sit next to each other are paired as “changed” lines and compared word by word or character by character. You can switch between a side-by-side view and a unified view, both with line numbers, and hide long runs of unchanged lines so only the edits and three lines of context remain.
Options let you ignore whitespace differences and letter case, and counters show how many lines were added, removed, changed and left alone. The result can be copied or downloaded as a standard unified .diff patch. Both texts stay in your browser; nothing is uploaded.
How to use Text Compare
- Paste the older version into “Original text” and the newer one into “Changed text”, or use “Open file” above each box. “Load sample” shows an example.
- The comparison runs as you type. Choose “Side by side” or “Unified” above the result.
- Turn on “Ignore whitespace” or “Ignore case” if spacing or capitalisation changes should not count, and pick Words, Characters or Off under “Highlight within lines”.
- Use “Hide unchanged lines” to focus on the edits, and read the Lines added, Lines removed, Lines changed and Unchanged counters.
- Click “Copy patch” or “Download .diff” to save the differences in unified diff format.
Features
Real line alignment
A longest-common-subsequence diff means inserted or deleted lines do not shift the rest of the comparison.
Word and character highlights
Changed lines show exactly which words or characters differ, not just that the line changed.
Side-by-side and unified views
Both views have line numbers for the original and changed text, and unchanged runs can be collapsed.
Ignore whitespace and case
Treat lines that differ only in spacing or capitalisation as identical.
Unified patch export
Copy or download a standard .diff of the exact texts that tools like patch can read.
When to use it
- Check what a colleague changed in a contract or policy draft.
- Compare two versions of a configuration or .env file line by line.
- Find which rows were added or removed between two exports of a list.
- Review edits to a code snippet and share the result as a .diff patch.
- Proofread a corrected translation against the first draft word by word.
Frequently asked questions
How does this diff checker work?
It splits both texts into lines and uses the jsdiff library to find the longest common subsequence, the same approach as git diff. Lines only in the original are removed, lines only in the changed text are added, and neighbouring removed and added lines are paired as changed lines with word or character highlights.
What happens if I insert a line in the middle?
Only the inserted line is marked as added. Because lines are aligned rather than compared by position, the lines after it still match their counterparts.
Can it ignore spaces and capital letters?
Yes. “Ignore whitespace” treats runs of spaces and tabs as a single space and ignores spaces at the start and end of lines. “Ignore case” treats upper and lower case as equal. These options change the comparison view only; the downloaded patch always reflects the exact texts.
What is the difference between side-by-side and unified view?
Side by side shows the original on the left and the changed text on the right, row by row. Unified shows one column with removed lines marked - and added lines marked +, like the output of git diff.
Can I compare two files?
Yes. Use “Open file” above each box to load a plain-text file such as .txt, .csv, .json, .md or source code, up to 5 MB each. For Word or PDF files, copy their text into the boxes, or use a dedicated PDF comparison tool.
Are my texts uploaded or stored?
No. The comparison happens entirely in your browser and nothing is saved when you close the page.