How to Compare Text Online
Paste the original and revised text into their respective panels. Inspect added and removed lines, then return to the source document to make changes. Text diff is useful even when the content is not structured data.
Line-by-Line Diff Explained
The comparison aligns lines to expose insertions and deletions. A changed line can appear as one removed and one added line. Whitespace and line-ending differences can matter because the inputs are compared as text.
Added, Removed and Changed Lines
Added lines occur in the revised version, removed lines only in the original. Read nearby unchanged lines for context. A diff does not decide which version is correct or whether a change preserves behavior.
Text Diff vs JSON Diff
Use JSON Diff when you want parsed value comparison that ignores object-key order and formatting. Use Text Diff when whitespace, exact spelling or line structure is the subject of review.
Common Uses for Text Comparison
Compare configuration drafts, documentation edits and code snippets. Large unrelated inputs can be expensive to compare in the browser. Work with the relevant excerpt when the full documents make the result difficult to interpret.
More examples and technical details
What a Diff Is and How It Works
A diff is a compact summary of what changed between two versions of some text. Instead of re-reading both copies and hunting for differences by eye, you let the tool mark exactly which lines were added, which were removed, and which stayed the same. The classic approach works line by line and rests on a neat idea from computer science called the longest common subsequence.
At a high level the algorithm looks for the longest sequence of lines that appears, in order, in both versions. Those lines are the unchanged backbone shared by the two texts. Anything that is not part of that common backbone has to be either an insertion in the new version or a deletion from the old one, and that is precisely how the added and removed markers are worked out. It is the same core logic that powers the diff you see every day in Git.
Where Developers Use Diffing
Comparison shows up constantly once you start noticing it. Code review is built on it: a reviewer reads the diff of a pull request, not the whole file. Git uses it to store and merge history, and it is the thing you stare at when you resolve a merge conflict. Beyond code, people diff config files to spot drift between a staging and a production server, proofreaders compare two drafts of a document, and API developers diff two JSON responses to see what a change to the backend actually altered.
Unified vs side-by-side
A unified view stacks the changes in one column, prefixing removed lines with a minus and added lines with a plus, which is compact and reads well in a terminal. A side-by-side view puts the old version on the left and the new on the right so you can scan across for each change. Neither is better in the abstract; side-by-side is easier for large rewrites, unified is easier for small tweaks.
Line, word, and character diffs
Line diffs are the default and are perfect for source code. When a single line changed by one word, though, a line diff bluntly reports the entire line as removed and re-added, which hides the real edit. A word diff or a character diff zooms in and highlights just the token that moved, which is far kinder when you are proofreading prose or checking a one-character typo.
Ignore Whitespace and Ignore Case
Two options quietly save a lot of noise. Ignore-whitespace tells the comparison to treat reindented or reflowed text as unchanged, so a formatter that re-wrapped every line does not drown out the one real edit buried inside. Ignore-case does the same for capitalization, useful when a rename changed "Id" to "ID" everywhere and you only care about the substantive changes. Turn them off when the whitespace or the case is the change you are hunting for.
The comparison above runs entirely in your browser. Neither block of text is uploaded anywhere, so you can safely diff private source code, contracts, or API payloads.
Need something else? Explore every text tool in one place, all free and client-side.
Frequently asked questions
How do I compare two texts online?
Paste each version into its panel and inspect the highlighted differences.
What do added and removed lines mean?
Added lines appear only in the new input; removed lines appear only in the old input.
Can I compare code snippets?
Yes. It compares source text, but does not analyze whether code behavior changed.
Should I use JSON Diff for JSON files?
Yes, when you want structural value comparison. Text Diff remains useful for exact source changes.
Is either text uploaded?
No. Input is processed in this browser tab and is not uploaded by the tool. Copy and download are actions you control; ordinary page analytics do not receive tool input.