Text Diff Checker
Compare two texts online and see added and removed lines side by side.
Files are read on your device, as text, up to 10 MB each.
Runs in your browser. Nothing is uploaded.
What is Text Diff Checker?
A diff checker compares two pieces of text and shows exactly what changed between them: which lines were added, which were removed and which stayed the same. Developers use diffs to review code, compare configuration files and API responses, check what a deployment changed, and merge edits from different people. Writers and editors use them to see what changed between two drafts.
This online diff checker puts your original text on the left and the changed text on the right and compares them as you type. To compare two files, press Open file above each box or drop a file onto it. Added lines are green with a plus sign and removed lines are red with a minus sign, so the result is readable even without colour. When a line was edited rather than replaced, the individual words that changed are highlighted inside it, which makes a one-word edit easy to spot. You can switch between side-by-side and inline views, and long stretches of unchanged text are folded away so a small edit in a big file stays easy to find.
You can ignore differences in whitespace or in upper and lower case, swap the two sides with one click, and copy or download the result as a standard unified diff that works with git and patch. Large texts are compared in a background worker so the page stays responsive. Everything runs in your browser and nothing you paste is uploaded, so it is safe to compare private code and documents.
How to use
- Paste the original text in the left box and the changed text in the right box, or press Open file (or drop a file) above each box to compare two files. The comparison updates as you type, or press Compare.
- Read the summary to see how many lines were added and removed.
- Switch between the side-by-side and inline views, and expand any folded block of unchanged lines.
- Tick Ignore whitespace or Ignore case to hide differences you do not care about.
- Copy the result or download it as a .diff file to share it or use it as a patch.
Example
Input
Original: the quick brown fox Changed: the slow brown fox
Output
- the quick brown fox + the slow brown fox (the words "quick" and "slow" are highlighted)
Frequently asked questions
- Can I compare two files?
- Yes. Press Open file above a box, or drag a file onto it. Text files up to 10 MB are read on your device, in UTF-8 or UTF-16, and the file names are used in the downloaded diff. Binary files such as images, PDFs and zip archives are refused, because a line-by-line comparison would not mean anything. Nothing is uploaded.
- What does ignore whitespace do?
- It ignores spaces and tabs at the start and end of each line and treats runs of spaces inside a line as one, so re-indenting a block does not show up as a change. Differences between Windows and Unix line endings are always ignored.
- Why is a moved line shown as removed and added?
- A line diff compares text in order and does not track moves. A line that moved appears as a removal in its old place and an addition in its new place.
- Can I use the result as a patch?
- Yes. Download the .diff file or copy the unified diff. It uses the standard format with three lines of context around each change, so tools such as git apply and patch can read it.
- Is my text uploaded?
- No. Both texts are compared in your browser and nothing is sent to a server.
Related tools
- JSON DiffCompare two JSON documents and see every added, removed and changed value by path.
- JSON Formatter & ValidatorFormat, minify and validate JSON online with line-accurate error messages.
- Word CounterCount words, characters, sentences and paragraphs, with reading time, keyword density and a length limit.
- SQL FormatterFormat and minify SQL for PostgreSQL, MySQL, SQLite, SQL Server, Oracle, BigQuery and Snowflake.
- Regex TesterTest regular expressions online with live match highlighting and groups.
- Markdown PreviewerWrite Markdown and see a live preview with tables, task lists and code, then download it as .md or HTML.