Free Text Comparison Tool — Compare Two Texts Online and Find Every Difference Instantly
Paste any two versions of a text and instantly see a colour-coded diff showing exactly which lines were added, removed, or left unchanged. Inline character-level highlights pinpoint the precise words that changed. Options for case sensitivity, whitespace trimming, and collapsing unchanged sections make it equally useful for comparing code, documents, lists, or any plain text — no install, no sign-up, everything runs in your browser.
0 lines · 0 chars
0 lines · 0 chars
↑ Paste text in both fields above to see the comparison
How to Compare Two Texts
Comparing any two texts takes only a few seconds. Here is the full workflow:
- 1
Paste your original text
Click the 'Original Text' box on the left and paste (or type) the first version of your content — this is the baseline you are comparing from.
- 2
Paste your modified text
Click the 'Modified Text' box on the right and paste the second version — the one you want to check against the original.
- 3
Read the diff
The tool instantly shows a colour-coded diff below the inputs. Green lines with a '+' prefix were added in the modified version; red lines with a '−' prefix were removed. Unchanged lines appear without any colour. Where a line was edited rather than wholly replaced, the specific words that changed are highlighted within the line.
- 4
Check the stats
Above the diff you will see four cards: lines added, lines removed, unchanged lines, and a similarity percentage. These give you an instant summary without reading every line.
- 5
Adjust comparison options
Use the toggle buttons — Case sensitive, Ignore leading/trailing spaces, Line numbers, and Collapse unchanged — to tailor the comparison to your needs. All options update the result in real time.
- 6
Export the result
Click 'Copy diff' to copy a plain-text diff to your clipboard, or 'Download .txt' to save it. The export uses the standard unified-diff format (+/− prefixes) that any developer or text editor will recognise.
The comparison updates automatically whenever you change either input — there is no button to click.
What You Can Compare
The tool works for any plain text — here are some of the most common use cases.
Essay or document edits
- Input:
The company reported record revenue last quarter. - Output:
The company reported record profits last quarter.
Paste two drafts of an essay, report, or blog post to instantly see every sentence that was rephrased, added, or cut. The inline word highlights make it easy to spot subtle wording changes without reading every line.
Code changes
- Input:
const greet = (name) => "Hello, " + name; - Output:
const greet = (name, greeting = "Hello") => `${greeting}, ${name}!`;
Compare two versions of a function, config file, or SQL query. The diff shows exactly which parameters, operators, or string literals changed — useful when you cannot use a version-control diff.
List or data comparison
- Input:
apple banana cherry - Output:
apple blueberry cherry date
Paste two versions of a CSV, keyword list, or import file to find which entries were added or removed. The 'Collapse unchanged' option is especially useful here when comparing large lists with only a few changes.
About the Text Comparison Tool
The Text Comparison Tool is a free, browser-based diff checker that lets anyone compare two pieces of text in seconds. Paste an original and a modified version, and the tool immediately highlights every line that was added, removed, or kept the same — no downloading software, no sign-up, and no waiting.
Beyond simple line matching, the tool also performs character-level diff on changed line pairs, so you can see the exact words or characters that were edited — not just that a line changed. A similarity score gives you an at-a-glance measure of how close the two texts are, and the export options let you save or share the result as a standard unified-diff file.
Because every calculation runs locally in JavaScript, your text never leaves your device. This makes the tool safe for comparing confidential documents, source code, or any sensitive content.
Frequently Asked Questions about the Text Comparison Tool
The tool uses a Longest Common Subsequence (LCS) algorithm — the same algorithm used by most professional diff tools — to identify the minimum set of changes between two texts. Lines are then colour-coded green for additions and red for removals, and changed line pairs get character-level highlighting so you can see exactly which words changed.
The tool processes up to 2,000 lines per input — enough for the vast majority of documents, essays, or code files. If either input exceeds 2,000 lines, the first 2,000 are used and a warning is shown. Everything runs in your browser, so there are no server-side upload limits.
When Case sensitive is turned on (the default), 'Hello' and 'hello' are treated as different. Turning it off makes the comparison ignore capitalisation, so lines that differ only in case will be shown as equal. This is useful when comparing text that was reformatted or copy-pasted from a source that changed capitalisation.
When enabled, any whitespace at the very start or end of each line is stripped before comparison. This is helpful for comparing code or lists where indentation may have changed but the content is logically the same.
Similarity is calculated as (2 × unchanged lines) ÷ (original lines + modified lines) × 100. A score of 100 % means the texts are identical; a score of 0 % means they share no lines at all. It gives a quick at-a-glance measure of how much the two texts overlap.
Yes. Click 'Copy diff' to copy a plain-text unified diff to your clipboard, or 'Download .txt' to save it as a file. Each line in the export is prefixed with '+' for added, '-' for removed, or two spaces for unchanged.
Never. All comparison logic runs entirely in your browser using JavaScript. Your text is never uploaded, stored, or transmitted anywhere — making it safe for comparing sensitive documents, source code, or confidential copy.
When turned on, long stretches of identical lines are folded into a single '··· N unchanged lines ···' placeholder, so you can focus on the parts that actually changed. Three lines of context are always shown above and below each change.
All comparisons run entirely in your browser — your text never leaves your device.
Related Text Tools
Reverse any text instantly — flip…
Convert text to uppercase, lowercase, title…
Count words, characters, sentences, paragraphs, and…
Remove duplicate lines from text instantly.…
Count characters with and without spaces,…
Generate stylish Unicode fancy text for…
Sort lines alphabetically, reverse alphabetically, or…
Add decorative Unicode borders, symbol wraps,…
Validate any URL instantly. Get descriptive…
Format, beautify, and validate JSON instantly.…