Text & Writing Tools

Text Diff Checker

Compare two texts line by line with word-level highlights, side-by-side or inline, ignoring case, whitespace or blank lines.

  • Free
  • No sign-up
  • Runs in your browser

Text Diff

0 lines

0 lines

View
Differences
--

    Runs in your browser. Your inputs never leave your device.

    Quick Answer

    Paste the original text on the left and the changed text on the right, then press Compare. Removed lines are shown in red, added lines in green, and inside a changed line the exact words that differ are highlighted. You can ignore case, whitespace or blank lines, and the comparison runs entirely in your browser.

    How to Use

    1. Paste the original. Paste or type the original version in the first box.
    2. Paste the changed version. Paste the new version in the second box.
    3. Choose options. Ignore case, whitespace or blank lines if those differences do not matter, and pick side-by-side or inline view.
    4. Compare. Press Compare to see added, removed and changed lines with the changed words highlighted.

    Reading the Result

    What each colour and marker means
    MarkerMeaning
    − red lineThe line is in the original text but not in the changed text.
    + green lineThe line is in the changed text but not in the original.
    Highlighted wordsInside a changed line, only the words that differ are marked.
    Plain lineThe line is the same in both texts.
    … unchanged linesWith "Show only changes" on, long runs of identical lines are folded.

    Line numbers on each side refer to the original and the changed text, so you can find the same place in your own files. If the two texts are identical, or identical once the ignore options are applied, the checker says so instead of showing a list.

    When to Use a Diff Checker

    • Contracts and policies: see exactly which sentences changed between two drafts before you sign or publish.
    • Writing and editing: compare your text with an editor's version and accept or reject each change knowingly.
    • Code and configuration: spot the one changed setting between two versions of a config file or a pasted snippet.
    • Data: compare two exports of a list or CSV; for removing repeated lines first, use the duplicate line remover.

    Everything you paste stays on your device. The comparison runs in a Web Worker, a background thread inside this page, and nothing is saved when you leave.

    How the Comparison Works

    Diff = shortest edit script that turns the original lines into the changed lines (Myers' O(ND) algorithm)

    Both texts are split into lines, and each distinct line is given a number so lines can be compared instantly. Lines that are the same at the very start and end are matched first. The rest is compared with Eugene Myers' difference algorithm, the same approach used by git and GNU diff, which finds the smallest set of lines to remove and add. When a removed line is followed by an added line, the two are compared again word by word so only the changed words are highlighted. Very large rewrites are split at lines that appear exactly once in both texts (the 'patience' technique) so the result stays readable. The work runs in a background thread, so long documents do not freeze the page.

    • Removed: Lines in the original text that are not in the changed text.
    • Added: Lines in the changed text that are not in the original.
    • Changed: A removed line paired with the added line that replaced it, with word-level highlights.

    Worked Examples

    One line replaced

    Original: a / b / c · Changed: a / x / c

    1. a and c are in both texts and stay unchanged
    2. b was removed and x was added in its place

    Result: 1 removed, 1 added, 2 unchanged

    A word changed inside a sentence

    Original: The quick brown fox · Changed: The slow brown fox

    1. The lines differ, so the line counts as changed
    2. Word by word, only 'quick' was replaced by 'slow'

    Result: One changed line with 'quick' and 'slow' highlighted

    Ignoring case and spacing

    Original: Hello World · Changed: hello world · Ignore case and ignore whitespace: on

    1. Both lines become 'helloworld' for the comparison

    Result: The texts are reported as identical

    Common Mistakes to Avoid

    • Comparing text with different line endings: Files from Windows use CR LF line endings and files from macOS or Linux use LF. The checker treats all line endings as the same, but some other tools report every line as changed.
    • Forgetting invisible whitespace: Trailing spaces and tabs make two lines that look identical count as different. Turn on Ignore whitespace when only the words matter, and leave it off for code where indentation is meaningful.
    • Reading a moved paragraph as a change: A line diff shows a paragraph that moved as removed in one place and added in another. Look for the same text in both colours before assuming it was rewritten.
    • Pasting the two versions the wrong way round: The left box is treated as the original. If additions show as removals, use Swap to exchange the two texts.
    • Using a diff to compare formatted documents: Copying from a word processor or PDF can change line breaks, which makes whole paragraphs look different. Compare plain text, or turn on Ignore whitespace and Ignore blank lines.

    Frequently Asked Questions

    How do I compare two texts for differences?

    Paste the original version in the first box and the new version in the second, then press Compare. Added lines are green, removed lines are red, and changed words inside a line are highlighted.

    Is this text compare tool private?

    Yes. The comparison runs in your browser, in a background thread on this page. The texts are not uploaded, stored, or added to the page address.

    What is the difference between side-by-side and inline view?

    Side-by-side shows the original on the left and the changed text on the right, line by line. Inline shows one list with removed lines followed by the lines that replaced them, which is easier to read on a phone.

    Can I ignore case and whitespace when comparing?

    Yes. Ignore case treats 'Hello' and 'hello' as the same; Ignore whitespace ignores spaces and tabs inside and around lines; Ignore blank lines leaves empty lines out of the comparison.

    How large a text can I compare?

    Texts of many thousands of lines work. The diff runs in a background thread, and for long documents you can show only the changes with a few lines of context.

    What algorithm does the diff checker use?

    It uses Eugene Myers' O(ND) difference algorithm, the method behind GNU diff and git, with word-level comparison inside changed lines.

    Can I compare code with this tool?

    Yes. Paste any plain text, including source code, JSON or CSV. Leave Ignore whitespace off if indentation matters.

    Sources & References