Text Compare
Paste two versions of a text, or open two files, and every difference is marked as you type: the lines taken out in red, the lines put in in green, and inside an edited line the words that changed. Long unchanged stretches fold away, and any change can be taken across until the two texts agree.
What it does
- Side by side, or in one column the way a patch reads.
- Word or character precision inside a changed line.
- Capital letters ignored if you like, and spaces and tabs at line ends and between words; Windows and Unix line endings never count.
- Unchanged stretches folded to three lines of context, arrows that jump from change to change, and the lines removed and added counted.
- Any change taken from one side to the other, until the texts are the same.
- A unified diff to copy, or a .diff file that patch and git apply take.
- The fewest changed lines, as diff finds them; a hundred thousand lines compared in the background without holding up the page.
How to use it
- Paste or open the two texts, one on each side.
- Choose side by side or inline, and what to ignore.
- Step through the changes with the arrows; take any across with a click.
- Copy or download the diff.
What it does not do
- Syntax highlighting: the texts are compared as text, whatever language they are written in.
- Share links and saved diffs: they need a server, and the texts are often the thing that must not leave the machine.
- Word and PDF files, or folders: take the text out first, or use Compare PDF for PDFs; a folder is a job for a desktop program.
- Ignoring blank lines, or rules of your own: capitals and spaces are the two things set aside.
Questions
Why is a whole line marked when I changed one comma?
The line is tinted because it changed; inside it, only the comma is marked. A line with nothing opposite it is marked whole, because all of it is new.
What is a unified diff?
The format patch and git read: lines starting with - and +, and @@ headers saying where. Download it and apply it to the original with git apply.
How large a text can it compare?
Past 60,000 characters the comparison moves to a background thread and the page stays responsive. Sixty thousand lines against sixty thousand take about 1.3 seconds, most of it the browser laying out the text.
Does ignoring whitespace hide indentation changes?
Yes. Spaces and tabs at either end of a line are set aside, and a run of them between words counts as one, so a line that only changed its indent reads as unchanged.
Everything here runs in your browser. Nothing you type, paste or open is uploaded, and there is no account and no queue. How that works.
Often used with
- Compare PDF: the same comparison on the pages of two PDFs
- JSON Formatter: both versions formatted first, so the diff shows the change and not the whitespace
- Notepad: the earlier draft kept as a note to compare against
More in Text Tools
- Word Counter: Count words, characters, sentences and paragraphs as you type, with reading time, keyword density and readability.
- Case Converter: Convert text to Title Case by Chicago, AP, APA or MLA, sentence case, UPPER and lower case, or camelCase, snake_case, kebab-case and more.
- DOCX Viewer: Open a Word document in your browser, read it on its pages with its tracked changes and comments, and save it as a PDF.
All toolsAbout utilbrewPrivacy