How to Use a Diff Checker to Compare Text and Code: Reading the Changes, Cutting the Noise, and Saving a Patch
An editor sends back your essay with “a few small tweaks”. A config file worked yesterday and does not today. A colleague pastes a query that is almost, but not quite, the one you wrote. Each time the question is the same: what exactly changed? A diff checker answers it in seconds. This guide shows how to compare text and code with the free text compare tool above, how to read and quieten the result, how to save it as a patch, and — honestly — when a different diff tool is the better choice.

1. What a Diff Checker Does, and When You Need One
A diff checker takes an original and a modified copy of the same text and shows the smallest set of lines you would remove and add to turn one into the other. Everything else is marked unchanged.
Reach for a text difference finder whenever reading both versions would take longer than the answer is worth: an edited draft, a changed config file, a snippet under review, or this week’s export. As a code compare tool online it works for any language, because it compares plain lines of text. The result is one inline view with two line-number gutters, so you always know where a change sits in each file.
2. How to Compare Two Text Files in Four Steps
Here is how to compare two text files, or two pasted passages, with the tool above. It is an online diff checker free of accounts, sign-ups and usage counters.
- Add the original. Paste it under Original, or drop a file onto Drop file A. Any plain-text file works: code, CSV, JSON, logs, config and Markdown.
- Add the modified version. Paste it under Modified, or drop it onto Drop file B. For a file compare online that is all; the result updates as you type, with no Compare button.
- Tune the view. Tick Ignore whitespace or Ignore case, and pick word-level, character-level or lines-only highlighting. Sides the wrong way round? Swap flips them.
- Read the summary and export. A status line counts lines removed, added and unchanged, or says the two texts are identical. The Unified diff panel can be copied or downloaded as changes.patch.
That is the whole method to compare two texts online free. The page is responsive, so you can compare text on phone or tablet screens the same way; pasting is usually quicker there.
3. Ignore Whitespace, Ignore Case, and Word-Level Marks
The commonest complaint about any diff is noise: a one-word edit buried under lines that only look different. Three controls fix it.
Diff ignore whitespace
Collapses runs of spaces or tabs to one space and trims each line before matching. Re-indented code and trailing spaces stop showing up as changes.
Compare text ignore case
Treats upper and lower case as the same while matching lines. Use it for a heading changed to title case or SQL keywords rewritten in capitals.
Why does diff show whole file changed? Usually every line differs invisibly: the file was re-indented, or trailing spaces were added or stripped. Tick Ignore whitespace and the flood shrinks to the real edits. Differing line endings are not a cause here, because Windows and Unix line breaks are both recognised. The toggle cannot fix re-wrapped text, where the line breaks themselves moved; those lines genuinely are different.
When a diff shows changes but lines look identical, switch Inline highlighting to Character-level. A character level diff online marks the exact characters that differ, exposing a double space, a curly quote or a zero typed as a capital O. For prose, Word-level inline marks gives a cleaner word by word text comparison. Inline marks appear when a removed line is directly followed by its replacement, which is how most edits look.
4. How to Read a Unified Diff and Download a Patch
Below the visual comparison sits a read-only panel in the standard unified diff format, the same layout described in the GNU diffutils manual. Here is how to read a unified diff:
- --- original and +++ modified name the two sides.
- @@ lines open each hunk, a block of changes, and give the starting line and length of that block in each file.
- Lines starting with - were removed, lines starting with + were added, and lines starting with a space are context: three unchanged lines around each change so the patch can find its place.
That is also how to create a patch file from two files without a terminal. Press Download to save changes.patch, or Copy to paste it into a ticket. Standard tools such as git apply and patch understand the format, which makes this a handy diff checker for code review without git: compare the snippet before and after, and send the patch.
The patch is always strict. Ignore whitespace and Ignore case change only the visual view. The unified diff is computed on the exact text, spacing and capitalisation included.
5. Worked Examples: Essays, Configs, SQL, CSV and Lists
Compare two versions of an essay. Paste the first draft as the original and the revised draft as the modified text, then choose word-level marks. Each rewritten sentence shows the old wording marked as removed and the new wording highlighted. This is the quickest answer to how to find differences between two documents after an editor or teacher has worked on your text. Keep paragraphs wrapped the same way in both drafts, so one edit does not ripple through the lines after it.
Find what changed in a config file. Drop the last working version onto file A and the current one onto file B, tick Ignore whitespace, and the changed setting is usually the only highlighted line. Character-level marks catch a single altered digit in a port number.
Compare two SQL queries online. Tick both toggles. If one query is on a single line and the other spans many, tidy both with the SQL formatter first, and the join or filter that changed will stand out.
Compare two CSV files online. Each row is a line, so the diff lists rows added and removed between two exports. It compares text, not cells, so a re-ordered column makes every row differ.
How to compare two lists for differences. If the lists are not in the same order, sort and de-duplicate both with the line tools first; the diff then shows exactly which items appear in only one list.
6. What It Does Not Do, and What to Use Instead
A line diff is right for plain text and wrong for a few common jobs. Here is where to go instead.
- PDF documents. A PDF is not plain text, so dropping one here gives meaningless output. Use the PDF compare tool, or extract the text first with the PDF to TXT converter and diff the two text files.
- Word .docx files. These are packaged files, not text. Copy the text out of each document and paste it in.
- JSON with different key order or formatting. The diff compares lines, not meaning. To compare JSON files online reliably, run both through the JSON formatter so they share the same layout, then compare. Keys that were merely reordered will still show as removed and added lines.
- Spreadsheets as cells. Turn each sheet into CSV with the spreadsheet converter, then compare the text. Images and whole folders are not supported.
- Merging, side-by-side columns and similarity scores. There is no merge, the view is one inline column with unchanged sections shown in full, and there is no similarity or plagiarism score. For word statistics, the word counter helps.
- Saved or shared links. Diffs are not saved or given a link. Copy the patch or download changes.patch to keep a record.
There is no hard size limit, but very large files that differ on almost every line can feel slow; compare the relevant section instead.
7. Why Use the Cortexis Diff Checker
Many sites compare two texts. Fewer explain the result or give you a usable patch. Here is what is different.
Genuinely free, no account
No sign-up, no email and no daily limit. Paste two texts and the answer is already on screen.
A private diff checker
Contracts, configs with secrets and unreleased code are never stored on our servers, and nothing you compare is retained.
Never used for training
What you paste is never used to train any model. Your drafts and code stay yours.
Updates as you type
No Compare button. Edit either side or change an option and the result refreshes at once.
Word or character precision
Inline marks show the exact words or characters that changed inside a line, not just which line changed.
A real patch file
A standard unified diff with three lines of context, ready to copy or download as changes.patch.
It sits alongside a wider set of free developer and document tools built on the same terms, from the regex tester to the case converter.
8. Frequently Asked Questions (FAQ)
How do I compare two texts online for free?
Paste the original into the Original box and the new version into the Modified box, or drop a text file onto each. The comparison appears immediately, with the changed words highlighted, and there is no account or limit.
Is it safe to compare confidential text here?
Yes. Nothing you paste or drop is stored on our servers, nothing is retained, and nothing is used for training. Diffs are never saved or shared through links.
Why does the diff show the whole file as changed?
Most often the file was re-indented or trailing spaces changed, so every line differs invisibly. Tick Ignore whitespace and only the real edits remain. Re-wrapped text, where the line breaks moved, genuinely differs and cannot be hidden.
Can I ignore whitespace and capitalisation?
Yes. Ignore whitespace collapses runs of spaces and tabs and trims each line, and Ignore case treats upper and lower case as equal. Both affect the visual comparison only; the unified patch is always computed on the exact text.
How do I download the diff as a patch file?
Press Download in the Unified diff panel to save changes.patch in the standard unified format, or Copy to take the text. Tools such as git apply and patch can read it.
Can I compare PDF or Word documents?
Not directly, because both are packaged formats rather than plain text. For PDFs, use the PDF compare tool or extract the text with the PDF to TXT converter first. For Word files, copy the text out of each document and paste it in.
How do I compare two JSON files that are formatted differently?
Run both through the JSON formatter so they share the same indentation and layout, then paste them here. The diff compares lines rather than meaning, so keys that were only reordered will still appear as changes.
How do I compare two lists for differences?
Here is how to compare two lists for differences when they are in a different order: sort and de-duplicate both with the line tools first, then paste one list into each box. Items found in only one list show as removed or added lines. There is no ignore-line-order option, so unsorted lists show more changes than really exist.
How do I find what changed in a config file?
To find what changed in a config file, drop the last working copy onto Drop file A and the current copy onto Drop file B. Tick Ignore whitespace so re-indentation drops out, and switch to character-level marks to catch a single altered value. Configs with secrets are never stored on our servers, and nothing is retained.
Can I compare two versions of an essay?
Yes. To compare two versions of an essay, paste the first draft as the original and the revised draft as the modified text, then choose word-level marks. Every reworded sentence shows the old wording removed and the new wording highlighted. Keep paragraphs wrapped the same way in both drafts so one edit does not ripple through the following lines.
Does it merge changes or show two columns side by side?
No. It shows one inline column with separate line numbers for each version, and it has no merge or copy-across. To carry edits over, apply the downloaded patch with a tool that supports patches.
Found the change and need the next step? Tidy a payload with the JSON formatter, turn a CSV export into JSON with the CSV to JSON converter, check a string’s fingerprint with the hash generator, or compare the text of two PDFs with the PDF compare tool. To learn the developer workflow behind it, try our free full-stack web development course.

