In one line: A NimbusCalc text diff checker compares two token sequences and reports what was added, removed and left unchanged. Paste versions into Original text and Modified text, choose Compare by (Lines, Words or Characters), pick a Result view (Unified diff, Side by side or Statistics table), tick any of the four ignore checkboxes, and press Compare now. The text diff checker builds a longest common subsequence, then reports every token outside it as a change. Similarity equals twice the matching tokens divided by the combined token count, times 100. It is deterministic, local, and free.
Two exports of the same customer list landed in my inbox on a Tuesday. One had been edited by hand. I pasted both into the tool and got 3 added, 2 removed, 2 unchanged and 44.4 percent similarity. That number looked wrong until I counted the tokens myself. This is the debugging trail, written as I actually worked it.
Which granularity should I pick first?
A diff works on tokens, and a token can be a whole line, a word or a single character. The select labelled Compare by offers exactly three values: Lines, Words and Characters. The choice determines what counts as one change, so it determines the score.
| Granularity | Token | Best for | Trade-off |
|---|---|---|---|
| Lines | One line of text | Source code, logs, config files, CSV rows | A single changed character marks the whole line as changed. |
| Words | Word or whitespace run | Prose, contracts, product descriptions, translations | Line breaks become ordinary whitespace tokens. |
| Characters | One Unicode character | Short strings, identifiers, hashes, one-line values | Long texts create many tokens and noisier output. |
I had pasted prose with hard line breaks, so line mode was the wrong lens. Switching to words made the edits legible. For short identifiers such as a hash, character mode is the only one that shows which glyph moved.
What the four checkboxes actually change

Below the two selects sit four labelled checkboxes: Ignore case, Ignore whitespace differences, Trim leading and trailing spaces and Skip empty lines. All four are off on load. They change the comparison keys, never the displayed text. That distinction matters. With Ignore case on, Hello and hello produce 0 changes while the original spelling is still shown. With Trim enabled, a trailing space no longer appears as a phantom edit.
Buttons read Compare now, Swap sides, Load sample, Clear both, Copy plain diff and Copy CSV. Swap sides is more useful than it looks: because the similarity coefficient is symmetric, swapping the two texts never changes the score, only which column is called original.
Reproducing the 44.4 percent result, step by step
- Load sample. Original text holds The quick brown fox, jumps over the lazy dog, Line three stays the same and End of file. Modified text holds The quick red fox, jumps over the sleepy dog, Line three stays the same, A new line was added and End of file.
- Keep Compare by set to Lines and Result view to Unified diff. Leave all four ignore checkboxes off.
- Press Compare now. The header reads 3 added, 2 removed, 2 unchanged, 44.4 percent similarity, Original: 4 tokens, Modified: 5 tokens, Showing 5 changed tokens. Red marks removals, green marks additions.
- Read the DIFFERENCE VIEW. Two paired deletion and addition rows, one unchanged row, one added row and one final unchanged row. Line numbers appear on the left of each row.
- Check the arithmetic. Similarity is 2 times 2 matching tokens divided by 4 plus 5, times 100, which is 4/9 or 44.4 percent. Two identical texts score 100 percent; two texts with no common tokens score 0 percent.
How the algorithm reaches its verdict
The core is the longest common subsequence, abbreviated LCS: tokens appearing in both texts in the same order, with gaps allowed. For sequences of length n and m, a dynamic programming table of n times m cells holds the LCS length of the first i tokens of A and the first j tokens of B. Matching tokens add one to the diagonal cell; otherwise the cell takes the larger of the cell above and the cell to the left. Walking backwards reconstructs the diff, and ties favour deletions for stability. Eugene W. Myers published his O(ND) difference algorithm in Algorithmica in 1986. POSIX.1-2017 defines the normal, unified and context diff formats.
Time and memory grow with the product of the input sizes. The tool caps the dynamic programming table and falls back to a prefix-and-suffix comparison for very large inputs, reporting when that happens. For typical documents and code files the full algorithm runs instantly.
Reading the symbols and the three views

A minus sign with a red background is text present in the original but missing from the modified version. A plus sign with a green background is newly added text. A blank prefix on white is an unchanged token. Red and green describe insertions and deletions, not correctness: a green line is new text, not necessarily better text. Side by side puts the original on the left and the modified version on the right, with blank cells for missing rows. The Statistics table view reports counts instead of a visual diff. For changed lines the unified view runs a second word-level diff inside each paired deletion and addition, so the exact words that changed receive a stronger highlight.
How I fooled myself with the ignore options
- Diffing formatted output as lines. When a whole paragraph is one line, switch to word granularity.
- Treating a move as one change. A relocated block is reported as one deletion plus one addition, never as a move.
- Enabling ignore options too aggressively. Ignoring whitespace can hide meaningful indentation changes in code.
- Assuming the diff understands meaning. It compares token sequences, not semantics.
Where the diff sits alongside other NimbusCalc tools
Structured output usually arrives as JSON, so the JSON formatter and validator and the JSON formatter guide come before or after the comparison. Pre-validation patterns are easier to build in the regex tester and validator, documented in the regex tester guide, and long prose is often cleaned by the article formatting tool first. Two guides in this batch use the same positional reasoning: the base64 encoder guide compares byte sequences, and the IBAN validator guide compares a computed checksum against an expected remainder.
Reader questions about this text diff checker
Reader question: what algorithm does this diff checker use? It computes a longest common subsequence with dynamic programming, then reports tokens outside that subsequence as additions and deletions.
Reader question: what is the difference between line, word and character diff? A line diff compares whole lines, a word diff compares words and whitespace tokens, and a character diff compares single Unicode characters. Choose line diff for code and word diff for prose.
Reader question: what does the similarity percentage mean? It is twice the matching tokens divided by the total tokens in both texts, expressed as a percentage. Identical texts score 100 percent and completely different texts score 0 percent.
Reader question: how do I ignore whitespace-only changes? Enable Ignore whitespace differences or Trim leading and trailing spaces. The comparison uses normalised keys while the display still shows the original text.
Reader question: is my text uploaded anywhere? No. Both texts are compared locally in your browser with JavaScript. Nothing is sent to a server, stored or logged.