Text Diff Checker
Paste two versions of any text, code or configuration file to see exactly what changed. Additions and removals are highlighted by line, word or character, side by side or inline, and you can copy the result as a standard unified patch. Everything runs in your browser.
Paste two texts and click Compare. Removed text is shown in red, added text in green.
How to compare two texts
- Paste both versionsPut the older text on the left (Original) and the newer text on the right (Changed). Swap flips them.
- Choose how to compareLines for code and config files, words for prose and documents, characters for typos and short strings.
- Click CompareRemoved text is red and struck through, added text is green. Unchanged lines stay plain so you keep the context.
- Copy or download the patchThe copy and download buttons give you a unified diff (.patch) that git, code review tools and patch utilities understand.
Line, word and character diffs
A line diff treats each line as one unit. It is what git and most code review tools show, and it is the clearest view for source code, JSON, YAML, CSV and log files, where a change usually affects whole lines. A word diff splits the text into words and punctuation, so editing one word in a long paragraph highlights just that word instead of the whole paragraph. Use it for contracts, articles, translations and emails. A character diff compares letter by letter; it is best for short values such as IDs, URLs, hashes or spelling changes like "color" and "colour".
The comparison uses the Myers difference algorithm (the same idea behind diff and git), through the open-source jsdiff library. It finds the smallest set of insertions and deletions that turns the original into the changed text, so the highlighted changes are as short as possible.
Ignore case and ignore spacing
Tick Ignore case when capitalisation does not matter, for example when comparing SQL keywords or email addresses. Tick Ignore spacing to skip changes that only add or remove spaces and tabs, such as re-indented code or trailing whitespace from different editors. The texts themselves are never changed; the options only affect what counts as a difference.
Inline or side by side
The inline view shows one merged text with removals and additions marked in place, which works well on phones and for short edits. The side-by-side view lines up the original and the changed version in two columns, with changed lines paired on the same row, which is easier to scan for long files on a wide screen.
Common uses
- Checking what changed between two versions of a configuration file before a deploy.
- Reviewing edits to a contract, policy or essay when tracked changes were not turned on.
- Comparing API responses, SQL queries or log output from two environments.
- Spotting a single changed character in a long token, URL or key.
- Creating a patch file to share a small change with someone who uses git.
Comparing JSON documents? The JSON Compare tool understands structure, so reordered keys are not reported as changes.
Frequently asked questions
Is my text uploaded anywhere?
No. Both texts are compared in your browser with JavaScript. Nothing is sent to a server or saved, so it is safe for private documents and source code.
How large can the texts be?
Several megabytes work in a modern browser. Very large files with many changes take longer in word or character mode, so use line mode first to find the changed area.
What is a unified diff or patch?
A plain-text format that lists removed lines with a minus sign and added lines with a plus sign, grouped into hunks with line numbers. Tools such as git apply and patch can apply it to the original file.
Why does a moved paragraph show as removed and added?
Diff algorithms describe changes as insertions and deletions. A block that moved is removed from its old place and added at its new place.
Can it compare Word or PDF files?
Copy the text out of the document and paste it here. For PDFs you can use PDF to Word or OCR PDF first to get the text.