HassleFreeTools

Text Diff Checker

Compare two texts and see what was added, removed or changed, line by line, word by word or character by character.

0 lines · 0 characters

0 lines · 0 characters

Compare by

Runs entirely in your browser. Your files and text are not uploaded.

How to use Text Diff Checker

  1. Step 1: Add both versions

    Paste the original text on the left and the changed text on the right, or open a text file for each.

  2. Step 2: Choose how to compare

    Compare by lines, words or characters, and ignore case or whitespace changes if they do not matter.

  3. Step 3: Review and share

    Press “Compare texts”, check the highlighted changes, then copy or download the unified diff.

How the comparison works

The checker first compares the two texts line by line with the Myers difference algorithm, the method behind diff and git diff, using the open-source jsdiff library. It finds the largest set of lines that appear in both texts in the same order, and marks every other line as removed from the original or added in the changed text. An edited line therefore shows up as one removed line and one added line.

  • Lines stops there: each changed line is highlighted as a whole.
  • Words then compares each block of changed lines word by word, so you can see exactly which words were replaced, added or removed. Punctuation marks count as separate words.
  • Characters does the same character by character, which helps you spot typos, changed numbers or a missing comma.

When a changed line has very little in common with the line it replaced, the word or character highlights are left out, because marking almost every letter is harder to read than the whole line.

Ignore options

  • Ignore case treats capital and small letters as the same, so "Hello" and "hello" match.
  • Ignore whitespace changes treats lines as equal when they differ only in spaces or tabs: indentation, double spaces between words, or spaces at the end of a line. Blank lines that were added or removed still count as changes.

The text on screen is always your own text. The options only change what counts as a difference.

Reading the result

Removed lines have a red background and a minus sign, and added lines have a green background and a plus sign. In word and character mode the exact changes are also struck through (removed) or underlined (added), so the result does not depend on colour alone. Long stretches of unchanged lines are folded, keeping three lines of context around each change; use the "Show … unchanged lines" button to open them.

The side-by-side view puts the two versions next to each other. The unified view lists everything in one column, which is easier to read on a phone. The counts above the table show how many lines were added, removed and left unchanged.

Unified diff

"Copy diff" and "Download .diff" give you the changes in the unified diff format used by diff -u and Git, with three lines of context. You can paste it into an email, a code review or a support ticket.

Privacy

Both texts are compared in your browser, normally in a background thread so the page stays responsive. Nothing is uploaded or stored.

Limitations

  • Each text can have up to 1 million characters (about 1 MB). Very long texts that are also very different can take too long to compare; the tool then asks you to compare smaller sections.
  • Word and character highlights are worked out only for blocks of changed lines up to about 60,000 characters (words) or 12,000 characters (characters). Larger blocks are shown as whole changed lines.
  • Moved paragraphs are shown as removed in one place and added in another. Moves are not detected.
  • Only plain text is compared. Word documents, PDFs and other formatted files cannot be opened, and formatting such as bold or colours is not compared.
  • At most 3,000 rows are drawn on the page. The copied or downloaded diff always contains every change.
  • Windows (CRLF) and Unix (LF) line endings are treated the same, and a missing line break at the very end of a text does not count as a difference.

Frequently asked questions

What is the difference between the side-by-side and unified views?

Side by side shows the original on the left and the changed text on the right, with matching lines next to each other. Unified shows a single column in which removed lines are followed by the lines that replaced them, like the output of git diff. Unified is easier to read on a phone.

Can I compare two files?

Yes. Use "Open file" above each box to load a plain-text file such as .txt, .csv, .md, .json, .html or source code, up to 4 MB. The file is read in your browser, not uploaded. Word documents and PDFs are not plain text, so copy their text and paste it instead.

Why is an edited line shown as removed and added?

Diff tools compare whole lines, so an edited line is the old version removed and the new version added. Choose Words or Characters to see exactly what changed inside the line.

Does "Ignore whitespace changes" also ignore empty lines?

No. It ignores differences in spaces and tabs within and around lines, such as indentation or double spaces. A blank line that was added or removed still counts as a change.

What can I do with the unified diff?

Paste it into a code review, an email or a ticket to show exactly what changed. It uses the standard format of diff -u and Git, so patch tools can usually read it. If you ignored case or whitespace, the diff follows that choice and may not apply cleanly as a patch.

Are my texts uploaded or saved?

No. The comparison runs in your browser and nothing is sent to a server. Closing or refreshing the page clears both texts.

Change text to UPPERCASE, lowercase, Title Case, Sentence case, camelCase, snake_case and more. The result updates as you type.

Count words, characters, sentences and paragraphs as you type, with reading time and keyword density.

Delete repeated lines from a list while keeping the original order, with options to ignore case, extra spaces and empty lines.

Sort lines alphabetically, in natural number order, by number or by length, or reverse and shuffle them, with sorting rules for Hindi and other languages.

Find text and replace it in one step, with match case, whole word and regular expression options, highlighted matches and a count.

Format, minify and validate JSON in your browser. Errors are shown with the exact line and column, and numbers are kept exactly as written.