Compare Text Online

Compare two texts or text files and see every change.

Input
Output

What is Compare Text?

Compare Text is a free online text compare tool. It takes two pieces of text and shows you exactly what changed between them. Paste the old version on the left and the new version on the right, and the differences light up in colour: green means added, red means removed.

It works for anything plain text: paragraphs of writing, code snippets, configuration files, contract clauses, translations. Lines that match stay neutral, so your eye goes straight to what's different. To compare text files instead of pasted text, upload one file into each side.

Use it when you want to compare text online without installing a desktop diff tool. No signup, and no record of what you compared unless you choose to share it.

What it does

Compare Text takes two pieces of text and highlights what was added in green and what was removed in red. It pairs up matching lines first, then compares each edited pair character by character, so a single missing comma or a renamed variable is highlighted on its own. The engine is Google's diff-match-patch library (Apache 2.0). The general technique is called a diff, and the underlying problem (finding the smallest set of edits between two strings) reduces to the classic longest common subsequence problem.

Prose and code go through the same engine. Because lines are paired before anything else, an edited sentence is compared with the sentence it came from, not with whatever line happens to sit next to it. If you're comparing structured data instead of prose, our JSON diff tool parses both sides first and ignores key order.

The diff needs no server. Your text is read by JavaScript using the FileReader API, compared in memory, and the result is drawn back into the page. Close the tab and it's gone, unless you pressed Share, which keeps a copy on our secure servers until the link expires.

How to compare two texts

Three steps, whether you paste two texts or compare two text files. The diff updates as you type, so there's no compare button to press.

  1. 1

    Add the original

    Put it in the left panel by pasting, or use Upload to open a text file: .txt, .md and .log, data files like .csv and .json, or config files like .yaml, .ini, .conf and .env. Sample drops in a short example if you just want to see the tool in action.

  2. 2

    Add the updated version

    Paste or upload it on the right. As soon as both panels have content, deletions show up in red on the left and additions in green on the right.

  3. 3

    Review the changes

    Scroll either side, both panels stay in sync. The header tells you how many changes were detected. Copy or Download either text once you're happy with the result.

When this is useful

Spotting redline edits in a contract

Paste V1 of a vendor agreement on the left and the redlined V2 on the right. A lowered liability cap or a payment term cut from 60 days to 30 is highlighted without rereading the whole agreement. Useful when the other side sends a clean copy without track-changes turned on.

Proofreading drafts and copy edits

Compare your draft against an editor's revised version, or your blog post before and after a copy edit. Every word that changed shows up; you don't have to reread the whole piece to find the dropped sentence.

Reviewing a translation pass

Original on one side, the translator's revisions on the other. Spot which idioms got rewritten and where the editor pushed back on a literal rendering. Saves a second pass through the whole document when you trust the reviewer.

Diffing configuration files

nginx.conf, systemd unit files, .env templates: paste the old and new version side by side. Faster than firing up diff in a terminal when both files are already in your clipboard from a chat thread.

Comparing log file snapshots

Yesterday's deploy log against today's, or the same job's output from two CI runs. Stable lines fade into the background and the new error pattern stands out. For multi-megabyte logs, narrow to the relevant subset with grep first.

Text diff quick reference

What the tool does with line endings, invisible characters, encodings and very large inputs, and why.

TopicWhat this tool does
Line endings Treated as equal. CRLF, LF and CR all end a line in the editor, so a Windows copy and a Unix copy of the same text compare clean.
Trailing whitespace Shown as a real difference. The highlight extends past the visible character. Useful for catching trailing spaces in YAML or CSV that quietly break parsers.
Unicode normalisation café with a precomposed é (U+00E9) is one character; the decomposed form e + combining accent (U+0301) is two. They render identically but diff differently. Apply Unicode Normalization Form C with String.prototype.normalize() to make them match.
Match granularity Lines are paired first, then compared character by character, with a semantic-cleanup pass that groups changes at word boundaries when it can. That is why short common words sometimes look matched across two otherwise unrelated lines.
File encoding Uploaded files are read as UTF-8 via the FileReader API, or as UTF-16 when the file starts with a byte-order mark. Other encodings will appear garbled. Convert in advance, or paste from a tool that has already decoded the file.
Large inputs A 1 MB file with 81,000 lines and 100 scattered edits shows every edit in under a second on a laptop. Above 3,000 lines only the visible lines are drawn, which keeps scrolling smooth; very large inputs are limited by your device's memory.
Empty side If one pane is empty, the other side shows entirely as an addition (or deletion). That is the diff behaving correctly, not a bug.
Identical input When both sides match exactly, including whitespace and Unicode form, there are zero changes and the headers do not show counts.

Compare Text: questions people ask

How do I compare two texts online?

Paste your first version into the left panel and the second into the right. The differences appear instantly, with no compare button and no signup. Additions show in green, removals in red, and the highlighting works right down to the individual character, so a single swapped word or number is easy to spot. The comparison runs in your browser, so your text stays on your device unless you choose to share it.

How do I find the difference between two texts?

Drop the two versions side by side and Compare Text highlights exactly what was added, removed, or reworded. It combines line-by-line and character-level diffing, which is what lets it catch the small edits you'd miss re-reading by eye: a moved clause, a flipped digit, a dropped "not". It works the same way for prose, code, configs, or any plain text you can paste.

Can I compare two text files?

Yes. Click Upload above the left panel and pick the first file, then do the same above the right panel for the second. Plain text (.txt, .md, .log), data (.csv, .tsv, .json, .xml), web and code files (.html, .css, .js, .sql) and configs (.yaml, .ini, .toml, .conf, .env) all work, and each file opens in the editor, so you can tidy it up before comparing. Word and PDF files need their text copied out first, because the tool compares plain text rather than document formats.

Is this text compare tool free?

Yes. There is no account, no trial and no limit on how often you compare text; the site is paid for by ads. Signing in is optional and only adds a list of the comparisons you have shared, so you can find or delete them later. Every format page, from JSON to contracts, is free in the same way.

Is a text comparator the same as a diff checker?

Yes, they are different names for the same kind of tool. Text comparator, text comparer, text compare tool, difference checker and diff checker all mean a program that takes two texts and marks what was added, removed or changed. Compare Text does that in the browser and goes one step further than many: inside an edited line it highlights only the characters that changed, not the whole line.

Does this save my text?

Not unless you ask it to. The comparison runs inside your browser, and nothing is logged or stored while you work. The one time your text reaches our servers is when you click Share: the link needs both texts saved somewhere, and they are deleted once the expiry you picked runs out. Skip Share and closing the tab is the end of it.

When should I use the JSON diff instead?

A text diff compares characters in order, so reordering keys in JSON or reformatting whitespace shows up as differences even when the data is identical. If you're comparing JSON specifically, use the Compare JSON tool instead. Its Format button lays both sides out the same way and Sort keys puts their keys in the same order. For prose, configs, plain code, or anything that isn't structured data, text diff is what you want.

Does it handle Windows vs Unix line endings (CRLF vs LF)?

Yes. The editor splits lines on CRLF, LF and the old Mac CR alike, so a Windows file pasted or uploaded against a Unix copy of the same text shows no changes. That also means this tool will not tell you which line endings a file uses. If that is what you need to check, run file name.txt in a terminal or look at the status bar of your code editor.

How much text can I paste before it slows down?

More than most people need. Texts of a few thousand lines compare as you type. In our tests a 1 MB file with 81,000 lines and 100 edits spread through it showed all 100 in under a second on a laptop, and typing in it stayed at about a tenth of a second per key. Above 3,000 lines the editor draws only the lines on screen, so your browser's Ctrl+F searches the visible part; use the up and down change buttons to move between differences instead.

Why does the diff sometimes look fragmented?

When an edited line still resembles its original, only the characters that differ are marked, and inside a word that can be just a few letters: jumps and leaps share their last two, so only jum and lea light up. When a line has been rewritten so heavily that little of it survives, the tool stops matching pieces and shows the old line as removed and the new one as added, which is easier to read than a scatter of tiny highlights.

Can I compare files in different encodings?

Files uploaded via the upload button are read as UTF-8 (the FileReader default). A UTF-16 file with a byte-order mark is recognised too. Files in other encodings (Latin-1, Shift-JIS, Windows-1252) will appear garbled; convert them to UTF-8 first. For text already in your clipboard, your OS has resolved the encoding before you paste, so it generally just works.