Free online tools

Text compare

Compare two texts online and see every change, line by line and word by word, as you type. It runs in your browser: your text never leaves your device.

Paste two texts to see the differences.

Runs in your browser. Your text never leaves your device.

Featured

Try these next

All text tools →

How to compare text online

  1. Paste the original text in the left box and the new version in the right box. Drafting longer text? Write it in the online notepad first.
  2. Read the dark card. The number is how many lines changed: added, removed and edited lines together. Red rows were removed, green rows were added, and the darker highlight inside a line marks the exact words that changed.
  3. Use Next and Previous, or the n and p keys, to jump from change to change.
  4. Tick Ignore case or Ignore spaces when those differences do not matter, then copy the diff or download it.

What is a diff checker?

A diff checker, also called a text difference checker or text compare tool, shows what changed between two versions of a text. Paste the original and the new version, and every added, removed and edited line is marked, with the exact changed words highlighted. Developers use a diff checker to review code and config changes; writers use one to see every edit in a draft.

What the text compare counts

A text compare, also called a diff checker or text difference checker, finds the smallest set of line insertions and deletions that turns the original into the modified text. This page uses the Myers difference algorithm, the same family of method that GNU diff and Git use, to match lines. When a line was edited rather than replaced, a second pass compares its words, so one changed word is highlighted instead of the whole sentence.

The dark card counts lines that changed: added, removed and edited lines together. The four small cards show added lines, removed lines, changed lines (a line whose text changed in place) and unchanged lines. Next and Previous step through the change groups, where a group is a run of changed lines between unchanged ones.

Ignore case and ignore spaces

Both options change the count at once. They never change the text you see: an ignored difference is shown as unchanged. Ignore spaces treats each run of spaces and tabs as one space, and ignores spaces at the start and end of a line, so a line that differs only by indentation or trailing spaces counts as unchanged.

They help when you compare documents that were re-indented, code formatted by a different editor, or text copied from a web page with extra spacing.

Split or unified view

ViewBest forWhat you see
SplitReading prose or reviewing edits side by sideOriginal on the left, modified on the right, rows lined up
UnifiedCode review, narrow screens, sharing a patchOne column: - for removed lines, + for added lines

On phones the page opens in unified view. You can switch to split and scroll the table sideways.

Copy or download the diff

Copy diff puts a unified diff on the clipboard. It starts with --- and +++ lines and @@ hunk headers, then each line starts with a space (unchanged, with three lines of context around each change), - (removed) or + (added). Copy as Markdown wraps the same lines in a diff code block for an issue, a pull request comment or a chat message. Download .patch saves the same text as a file.

Your text stays on your device

The comparison runs in your browser, in this page’s own script. The page sends no text anywhere: no upload, no account. Your two texts are kept only in this browser tab (sessionStorage), so a reload restores them and closing the tab clears them. The network counter under the tool counts the requests your browser makes after your first edit (web fonts are not counted), so you can check the claim yourself.

Limits and speed

You can open a file of up to 2 MB into each box. Pasting has no size limit. In our tests, comparing 5,000 lines with 5% of them edited took about 10 milliseconds of calculation. A very large text with thousands of changes shows the first 1,000 change groups on screen so the page stays responsive; Copy diff and Download .patch always include every change.

Tips for comparing code, config and prose

Frequently asked questions

Is this a diff checker?

Yes. It is a text diff checker: it lists every line and word that differs between two texts, live as you type, and it can copy or download the result as a unified diff.

Is my text sent to your server?

No. The comparison runs in your browser. Nothing you paste or open is uploaded, and the page has no account or sign-up.

How does this text compare work?

Both texts are split into lines. A line-level Myers diff finds the shortest list of insertions and deletions that turns one into the other. Lines that were edited are then compared word by word.

Can I compare code, JSON or config files?

Yes. Any plain-text file works, such as .txt, .md, .json, .js, .css, .csv or .yaml. The page compares the text as-is and does not colour the syntax.

What is the difference between split and unified view?

Split shows the original and the modified text side by side with the rows lined up. Unified shows one column, with a minus for removed lines and a plus for added lines, the way Git shows changes.

How do I ignore whitespace or capitalization?

Tick Ignore spaces to treat runs of spaces and tabs as one space and to ignore spaces at the start and end of a line, or Ignore case to treat upper and lower case as equal. The count updates at once.

Can I copy or download the diff for Git?

Yes. Copy diff gives a unified diff with headers and hunk markers, and Download .patch saves the same text as a file. Copy as Markdown wraps it in a diff code block for a comment.

Can I compare two files without pasting?

Yes. Press Open file in either box, or drag a text file onto it. The file is read in your browser.

Is there a file size limit?

Yes, for files you open: up to 2 MB into each box. Pasting has no size limit. A very large text with thousands of changes shows the first 1,000 change groups on screen; Copy diff and Download .patch include all of them.

Does it work on a phone?

Yes. On a phone the page opens in unified view, the two boxes stack one above the other, and the counts and Previous and Next buttons stay pinned to the top while you scroll the diff.

How does this compare with other text diff tools?

This tool has no sign-up, updates the diff as you type, and runs in your browser. The network counter under the tool shows the requests it makes, so you can check that your text stays on your device.

Missing something in the text compare?Suggest an idea. It takes 20 seconds and we read every one.Suggest an idea

Sends only what you type here, never the text you work with. Your email is used only to reply about this idea.

Free online tools