FlipMyFormat

Diff Checker

Compare two texts or files and see every added, removed and changed line, with the changed words or characters marked. Side by side or inline, ignore spaces, case or blank lines, sort JSON keys, and download a .diff file. Free and private.

Original
Changed
Mark inside lines

Private

Both texts and files are compared in your browser. Nothing is uploaded or saved.

Files it reads

TXT, Markdown, CSV, JSON, XML, HTML, code files, logs, PDF (text), Word (.docx) and Excel (.xlsx). For page layout changes in PDFs use Compare PDF.

People also use

Diff checker online: compare two texts in three steps

Paste the first version into the Original box and the second version into the Changed box. The comparison appears under the boxes straight away and updates as you type, so you can fix a line and watch its colour change. You can also drop a file on either box, or press File above it to open one.

This diff checker online works in any modern browser on a computer, tablet or phone. Both texts stay on your own device: the comparison is done by code in the page, and nothing is sent to a server. There is no account to make and no limit on how often you use it.

Lines that were removed are shown in red, lines that were added are shown in green, and lines that were edited are shown as a pair, with the exact words or characters that differ marked in a darker shade. A summary line counts the changes, and the arrow buttons jump from one change to the next.

  1. 1

    Add both versions

    Paste or type the older text into Original and the newer text into Changed. Or drop a file on a box, or press File to open TXT, code, CSV, JSON, PDF, Word or Excel.

  2. 2

    Pick how to compare

    Choose Side by side or Inline, mark changes by Words or Characters, and tick Ignore spaces, Ignore case, Ignore blank lines, JSON (sort keys) or Only changes if you need them.

  3. 3

    Review and save

    Read the summary, step through the changes with the up and down arrows, and press .diff to download the result as a changes.diff file.

Your view and option choices are remembered in this browser for next time. The two texts themselves are not saved, so download the .diff file or copy what you need before you close the tab.

What each option and button does

Original and Changed

The two boxes. Original is the older or first version, shown on the left. Changed is the newer or second version, shown on the right. You can type, paste or edit in both at any time.

File

Opens a file from your device into that box. Dropping a file on the box does the same. The text of the file replaces whatever was in the box.

View: Side by side

Shows the two versions in two columns, with matching lines next to each other and line numbers on both sides. Good on a wide screen.

View: Inline

Shows one column. Removed lines have a minus sign and added lines a plus sign, each with its own line number. Easier to read on a phone.

Mark inside lines: Words or Characters

When a line was edited, Words marks the whole words that differ and Characters marks single letters, digits or symbols.

Ignore spaces

Treats any run of spaces or tabs as one space and ignores spaces at the start and end of a line, so indentation and spacing changes do not count.

Ignore case

Treats capital and small letters as the same, so Hello and hello match.

Ignore blank lines

Leaves out empty lines, and lines with only spaces, on both sides. The line numbers still show the real position in each text.

JSON (sort keys)

Reads both texts as JSON, puts the keys of every object in alphabetical order and formats them with a 2-space indent before comparing. Key order and layout stop mattering.

Only changes

Hides the lines that are the same and keeps the changes with 3 lines around each one, so long files are quick to review.

Swap

Moves the Changed text into Original and the Original text into Changed, so added lines become removed lines and the other way round.

Arrows and .diff

The up and down arrows jump to the previous or next change and loop around at the end. The .diff button downloads the comparison as a changes.diff file.

How to read the result and the summary of changes

The bar above the result gives the summary of changes. It reads, for example, 4 changes, followed by +3 added, −1 removed and 2 changed lines. A change is one block of lines that differ, with matching lines on both sides of it. One block can hold several lines, so the number of changes is often smaller than the number of lines.

An added line exists only in Changed and is shown in green. A removed line exists only in Original and is shown in red. A changed line is a line in Original that was replaced by a line in Changed: the tool shows the two side by side, the old one on red and the new one on green, and marks the exact part that differs in a stronger colour. In Side by side view, the empty space opposite an added or removed line is light grey, so the two columns stay lined up.

Here is a short example. Original holds three lines: Apples 3, Pears 5 and Plums 2. Changed holds Apples 3, Pears 6, Plums 2 and Cherries 4. The first and third lines match and have no colour. Pears 5 and Pears 6 are paired as a changed line, with only the number marked. Cherries 4 is a green added line at the end. The bar reads 2 changes, +1 added, −0 removed and 1 changed lines, because the edited line and the new line are two separate blocks.

When the two texts match, the bar says The two texts are identical. If any Ignore option is ticked, it adds (with the options above), as a reminder that small differences may exist but were set aside on purpose.

What you seeWhat it means
Green line, number on the rightAdded: the line is only in Changed.
Red line, number on the leftRemoved: the line is only in Original.
Red and green pair, darker marksChanged: the line was edited; the dark marks are the words or characters that differ.
No colourSame in both texts.
Minus and plus signs (Inline view)Minus is the old line, plus is the new line.

Diff checker for text: contracts, essays and lists

Most people need a diff checker for text that a computer did not write: a contract that came back from the other side, an essay after a round of edits, a policy page, a translation, or a list of names. Reading two versions side by side by eye is slow and it is easy to miss one changed word in a long paragraph. Here each edited line is paired with its new version and the edited words are marked, so the eye goes straight to them.

The comparison works line by line, and for prose a line is usually a whole paragraph. That is fine: the words that changed inside the paragraph are still marked. If a paragraph was split in two, you will see the old paragraph as changed and the second half as an added line.

If the texts were copied from different places, small differences in spaces or in capital letters can hide the real edits. Tick Ignore spaces and Ignore case to set them aside, and Ignore blank lines if one copy has empty lines between paragraphs and the other does not. To count the words in either version, paste it into the Word Counter; to change its letter case first, use the Case Converter.

Diff checker by character or by word

Mark inside lines decides how finely an edited line is marked. With Words, the line is split into words, numbers, single punctuation marks and runs of spaces, and the parts that differ are marked as whole words. This is the easiest way to read changes in sentences.

A diff checker by character goes one step further: with Characters chosen, every letter, digit and symbol is compared on its own. That is the right choice for things where a single character matters, such as a version number, a price, an ID, a URL, a date, a password hint or a line of code where only one bracket moved. For example, comparing order-1045 with order-1054 by Words marks all of 1045 and 1054, while Characters marks just the one or two digits that moved.

Mark inside linesEditWhat is marked
WordsThe total is 120 dollars → The total is 125 dollars120 and 125 are marked
CharactersThe total is 120 dollars → The total is 125 dollarsonly the 0 and the 5 are marked
Wordscolour → colorthe whole word is marked
Characterscolour → coloronly the u is marked

The choice only changes the marking inside lines. Which lines count as added, removed or changed stays the same. For a very long line that is completely different on both sides, the tool marks the whole line instead of hunting for tiny matches, which keeps the page fast.

Diff checker without whitespace, case or blank-line noise

Spaces are the most common source of noise in a comparison. One editor turns tabs into spaces, another strips spaces at the end of lines, and a copy from a web page adds a space here and there. Without help, every one of those lines shows up as changed even though nothing that matters is different.

A diff checker without whitespace noise is what Ignore spaces gives you. With it ticked, any run of spaces or tabs counts as a single space, and spaces at the start and end of each line are ignored. So a line indented with a tab matches the same line indented with four spaces, and two spaces between words match one. Lines that are the same apart from this are shown as unchanged.

Note what it does not do: it does not remove spaces altogether, so a + b and a+b are still different. Ignore case works the same way for capital letters, and Ignore blank lines leaves out empty lines on both sides, which helps when one version has extra line breaks between paragraphs. The three options can be combined.

Diff checker JSON mode: key order does not count

Two JSON files can hold exactly the same data and still look completely different as text. One may be on a single line, the other indented; one may list name before id, the other id before name. A plain line diff then marks almost everything.

That is why a diff checker json mode is built in. Tick JSON (sort keys) and both texts are read as JSON, the keys of every object at every level are put in alphabetical order, and both are written out with a 2-space indent before they are compared. Key order and layout stop counting, and only real changes in values, added keys and removed keys remain. Arrays keep their order, because in JSON the order of array items is part of the data.

If a box does not hold valid JSON, that side is compared as plain text instead, so nothing is lost. To find the error, paste the text into the JSON Formatter, which shows the line and column of the problem and can repair common slips such as trailing commas. When you need the data in another shape, CSV to JSON and JSON to CSV convert between the two.

Diff checker for code and code review

A diff checker for code is useful whenever two versions of a file are not in the same repository: a snippet from a forum against your own copy, a config file from a server against the one on your laptop, or two versions of a script that someone sent by email. The file picker reads common code and data files directly, including JS, TS, TSX, JSX, Python, Java, C, C++, C#, Go, Ruby, PHP, SQL, CSS, HTML, XML, YAML, INI and log files.

For code review, the Side by side view with line numbers works like the review screens people know from version control. Characters is a good marking choice for code, because a changed operator or a missing semicolon is a single character. Ignore spaces hides indentation and formatting changes when you only care about logic; untick it again when indentation matters, as it does in Python and YAML.

Only changes keeps each change with 3 lines of context around it, the same amount most review tools show by default. When you are done, press .diff to save the comparison and attach it to a ticket or a message.

The .diff download: Git-style unified format explained

A .diff file is plain text in the unified style that Git and other version control tools use to show changes. It starts with two header lines: --- original names the old version and +++ changed names the new one. After that, every line starts with one mark: a space for a line that is the same in both, a minus sign for a line that was removed, and a plus sign for a line that was added. An edited line appears twice, first with a minus sign and then with a plus sign.

The file written here contains every line of the comparison, not only the changed parts, so anyone can read the full context in any text editor. It does not include the @@ hunk headers with line ranges that patch tools need, so treat it as a readable record of the changes to share or keep, not as a patch to apply with a command.

The .diff file follows the options you chose. With Ignore blank lines ticked, empty lines are left out of it too, and with JSON (sort keys) ticked, it holds the sorted, formatted JSON. Only changes affects the screen only: the download always holds the whole comparison.

Line in the fileMeaning
--- originalheader: the old version
+++ changedheader: the new version
(space) linethe same in both versions
-lineonly in the old version, or the old form of an edited line
+lineonly in the new version, or the new form of an edited line

Diff checker for PDF text, and when to use Compare PDF

You can use this as a diff checker for PDF text. Drop a PDF on either box and the text of every page is read in your browser and placed in the box, page after page, with line breaks where the PDF has them. Then it is compared like any other text. This is handy for checking what changed in the wording of a contract, a report or a form between two versions.

Only the text layer is read. A scanned PDF has no text layer, so the box stays nearly empty; run it through Image to Text first to get the words out. The way a PDF stores its text also means line breaks can fall in slightly different places in two versions of the same document, which can show up as changed lines; Ignore spaces and Ignore blank lines help with that.

When the layout matters, such as moved images, changed fonts, a new logo or a table that shifted, a text comparison is not enough. Compare PDF shows the two documents page by page with the changes highlighted on the pages themselves, including a visual comparison. To keep the text of a PDF for editing, PDF to Text and PDF to Word save it as a file.

Diff checker for Excel, CSV and Word files

A diff checker for Excel files saves you from scanning two spreadsheets cell by cell. Open an .xlsx file in a box and each row becomes one line, with the cells of the row separated by tabs. Cells are read as they are displayed, and dates are written as year-month-day. If the workbook has more than one sheet, every sheet is included, each starting with a line that holds a # and the sheet name.

Because each row is a line, an added row shows up as an added line and an edited cell shows up as a changed line with the new value marked. This works best when both files have their rows in the same order; sort both the same way first if they do not. CSV and TSV files are compared the same way, one row per line, without any conversion.

Word .docx files are read as plain text, one paragraph per line. Formatting such as bold, colours and fonts is not compared, only the words. Older .xls and .doc files are not supported; save them as .xlsx or .docx first. To turn a spreadsheet into a document for sharing, Excel to PDF keeps the layout, and PDF to Excel brings tables from a PDF back into a sheet.

KindFile typesHow it is read
Text and notes.txt, .md, .log, .iniRead as they are
Data.csv, .tsv, .json, .xml, .yaml, .ymlRead as they are; JSON can be sorted
Web and code.html, .css, .js, .ts, .tsx, .jsx, .py, .java, .c, .cpp, .cs, .go, .rb, .php, .sqlRead as they are
PDF.pdfText of every page; no layout
Word.docxPlain text, one paragraph per line
Excel.xlsxOne row per line, cells separated by tabs, every sheet

Diff checker for large files and very different texts

There is no fixed size limit, because the files never leave your device: what your browser can hold, it can compare. A diff checker for large files has two jobs, though: finding the changes quickly, and showing them without freezing the page. Both are handled.

The comparison uses the Myers algorithm, which does work in proportion to the number of differences, not only the size of the files. Two long log files with a few changed lines are compared very quickly. If two texts differ in more than about 6,000 places, a full search would take too long, so the tool switches to a simpler mode: line 1 is compared with line 1, line 2 with line 2, and so on. The bar then says Very different texts: compared line by line in order.

The result shows up to 6,000 lines at a time. For bigger files, the note under the result tells you so; tick Only changes to see the changes with 3 lines around each, which is usually all you need. The .diff download always holds the whole comparison. Typing in a huge box repeats the comparison after each change, so for very big texts it is quicker to paste the final version than to edit it in place.

How the comparison works

Each text is split into lines. Windows and old Mac line endings are turned into plain line breaks first, so a file saved on Windows and the same file saved on a Mac match. Then any options you ticked are applied to a copy of each line used only for matching: spaces collapsed, letters made small, blank lines skipped. The original lines are still what you see.

Next, the Myers algorithm finds the shortest list of additions and removals that turns Original into Changed. It is the same family of algorithm behind the diff command and Git, and it keeps as many lines in place as possible, so a line inserted near the top does not make everything below it look different.

Because the matching copy is used only to decide which lines are equal, the text you see is never altered. With Ignore case ticked, for example, Hello and HELLO count as the same line, but each side still shows its own spelling, so you can see what the original really said.

Where a block of removed lines sits right next to a block of added lines, the tool pairs them up one by one as changed lines, and runs the same algorithm again inside each pair, on words or characters, to find the exact edits. Any extra lines in the block stay as plain added or removed lines.

Common jobs it helps with

Checking a returned contract

Paste your version and the one that came back, tick Ignore spaces, and read every changed word before you sign. For page layout changes, use Compare PDF.

Reviewing code outside Git

Compare a snippet against your file, or two copies of a script, with Characters marking and line numbers on both sides.

Comparing API responses

Paste two JSON responses, tick JSON (sort keys), and only fields that really changed remain.

Finding config drift

Compare a config file from one server with the same file from another to see which settings differ.

Spotting edits in an article

Paste the draft and the edited version to see what an editor changed, word by word.

Comparing two lists

Paste two lists of names, products or IDs, one per line, to see which entries were added or removed.

Checking a translation update

When a source text changes, compare the old and new source to see exactly which sentences need a fresh translation.

Reading log differences

Compare a log from a good run with one from a failed run, with Only changes ticked, to see where they part ways.

Checking a spreadsheet export

Open last month's and this month's .xlsx or .csv files to see which rows were added or changed.

Tips for clearer comparisons

Put the older version on the left

Original is meant for the first or older text. If added lines show as removed, press Swap.

Start strict, then relax

Look at the full comparison first, then tick Ignore spaces or Ignore case if small differences are hiding the ones you care about.

Use Characters for codes and numbers

IDs, prices, versions and dates often differ by one character. Characters marks exactly that one.

Use Words for prose

In sentences, whole marked words are easier to read than scattered letters.

Sort rows before comparing tables

If two exports list the same rows in a different order, sort both by the same column first, or the rows will show as moved.

Clean JSON first

If JSON (sort keys) seems to do nothing, one side may not be valid JSON. Check it in the JSON Formatter.

Use Only changes for long files

It keeps 3 lines around each change and hides the rest, so a long file fits on one screen.

Compare small pieces first

If a large file gives a confusing result, paste just the section you care about into both boxes. A smaller comparison is easier to read and quicker to check.

Check the line numbers

Line numbers show where each line sits in its own text, so you can find the same spot in your editor or document straight away.

Save the .diff before closing

The texts are not saved in the browser. Download the .diff file if you need a record.

Troubleshooting: when the result is not what you expected

Every line shows as changed

The usual cause is spacing or line endings. Tick Ignore spaces. If it is JSON with a different layout, tick JSON (sort keys) instead.

The two texts look the same but are not identical

Look for marks at the end of lines: a trailing space or tab shows as a marked gap. Ignore spaces sets these aside.

A moved paragraph shows as removed and added

A line diff has no idea of moves. A block moved elsewhere shows as removed in one place and added in another.

JSON (sort keys) changed nothing

One or both texts are not valid JSON, so they were compared as plain text. Fix the error in the JSON Formatter and paste it back.

A PDF box is empty or messy

Scanned PDFs have no text layer; use Image to Text first. Line breaks in PDFs follow the page layout, so Ignore blank lines can help.

The file could not be read

The message says the file could not be read when it is damaged, password protected, or in an old format such as .doc or .xls. Save it as .docx or .xlsx and try again.

It says compared line by line in order

The texts differ in too many places for a full comparison. Check that you opened the right two files; if so, the changes are still shown line for line.

Only part of the result is shown

Very long results show the first 6,000 lines. Tick Only changes to see the changes with their context.

Strange characters in a text file

Text files are read as UTF-8. A file saved in an older encoding can show odd symbols; open it in your editor and save it as UTF-8.

Diff checker free to use: no account, nothing uploaded

This is a diff checker free for anyone to use, as often as needed. There is no sign-up, no account, no daily limit and no paid version: every option on the page is open to everyone.

Both texts, and any files you open, are read and compared by code running in this page on your own device. Nothing is uploaded or stored on a server, which matters when you compare contracts, private notes, customer lists or source code. Only your view and option choices are remembered in your browser; the texts are gone when you close the tab.

Once the page has loaded, comparing keeps working if your connection drops. Opening a PDF, Word or Excel file for the first time loads a small reader in the background, so do that while you are still online.

What to do next

Comparing PDFs where layout matters? Compare PDF shows changes on the pages themselves. Need to tidy JSON before comparing? The JSON Formatter checks, repairs and sorts it. Want to prove two files are byte-for-byte the same without reading them? The Hash Generator gives each one a fingerprint you can compare.

Frequently asked questions

Is this diff checker online safe for private documents?

Yes. Both texts and any files you open are compared by code running in your browser, and nothing is uploaded or stored on a server. Only your option choices are remembered in your browser; the texts are not saved.

Is the diff checker free, or are some features paid?

It is free, and every feature is open to everyone: both views, all Ignore options, JSON mode, file opening and the .diff download. There is no account, sign-up or usage limit.

How do I use the diff checker for text such as contracts or essays?

Paste the older version into Original and the newer one into Changed. Edited lines are paired and the changed words are marked. Tick Ignore spaces and Ignore case if the copies came from different places.

How does the diff checker JSON option work?

Tick JSON (sort keys). Both texts are read as JSON, every object's keys are sorted alphabetically and the result is formatted with a 2-space indent before comparing, so key order and layout do not count. Arrays keep their order.

Can I use it as a diff checker for code review?

Yes. Use Side by side with line numbers, choose Characters to catch one-character edits, and tick Only changes to see each change with 3 lines of context. Press .diff to save the comparison for a ticket or message.

Does the diff checker for PDF compare layout or images?

No, it compares the text of every page only. For moved images, font changes or layout shifts, use the Compare PDF tool, which shows the changes on the pages. Scanned PDFs need text recognition first.

How does the diff checker for Excel files read a sheet?

Each row becomes one line with its cells separated by tabs, using the values as displayed and dates as year-month-day. Every sheet is included, each after a line with # and the sheet name. Only .xlsx is supported, not old .xls.

Is there a diff checker without whitespace differences?

Yes. Tick Ignore spaces. Any run of spaces or tabs then counts as one space, and spaces at the start and end of lines are ignored, so indentation and spacing changes are not shown. Spaces are not removed entirely, so a+b and a + b still differ.

Can I run the diff checker by character instead of by word?

Yes. Set Mark inside lines to Characters and each letter, digit and symbol in an edited line is compared on its own. Words, the default, marks whole words instead, which reads better for sentences.

Does the diff checker for large files have a size limit?

There is no fixed limit, because files are read on your device. The result shows up to 6,000 lines at a time, and Only changes shows every change with its context. Texts that differ in more than about 6,000 places are compared line by line in order.

What does the summary of changes mean?

The number of changes is the number of separate blocks that differ. Next to it you see how many lines were added, removed and changed. If nothing differs, it says The two texts are identical.

What is the difference between Side by side and Inline?

Side by side shows Original on the left and Changed on the right, with matching lines next to each other. Inline shows one column, with the old line marked minus and the new line marked plus. The changes found are the same.

What is in the downloaded .diff file?

A plain text file in unified style, with --- original and +++ changed headers and every line marked with a space, a minus sign or a plus sign. It holds the whole comparison and is meant for reading and sharing, not as a patch with @@ hunk headers.

Which file types can I open?

TXT, Markdown, CSV, TSV, JSON, XML, HTML, YAML, INI, logs and common code files such as JS, TS, Python, Java, C, C#, Go, Ruby, PHP and SQL, plus the text of PDF, Word .docx and Excel .xlsx files.

What does Ignore blank lines do?

It leaves out empty lines, and lines with only spaces, on both sides before comparing. The line numbers still show where each line really is in its text.

What does Only changes show?

Only the lines that differ, with 3 unchanged lines before and after each change for context. The rest is hidden on screen, but the .diff download still holds everything.

How do I jump between changes?

Use the up and down arrows in the summary bar. Each press scrolls to the previous or next change, and after the last one it goes back to the first.

What does Swap do?

It moves the Changed text into the Original box and the Original text into the Changed box. Lines that were shown as added are then shown as removed, and the other way round.

Why is a moved paragraph shown as removed and added?

A line comparison finds additions and removals, not moves. A block that moved shows as removed where it was and added where it is now.

Which algorithm does it use?

The Myers diff algorithm, the same family used by the diff command and Git. It finds the fewest additions and removals between the two texts, then compares paired lines again by words or characters.

Does it work on a phone?

Yes, in any modern mobile browser. The two boxes stack on a small screen, and the Inline view is easier to read there than Side by side.

Compare your texts now

Paste two versions or drop two files, and see every change marked as you type. Free and private.

Start comparing

Last updated October 2026 · Written and maintained by the FlipMyFormat team