Text diff checker
This page compares two blocks of text in the current browser tab and highlights every line that was added or removed. Paste the original draft in the left box and the revision in the right box. The Differences list updates as you type. FlashKit does not upload either document, does not keep a revision history, and does not need an account. Closing or refreshing the tab clears both sides.
The algorithm is a line-level longest common subsequence (LCS). Each box is split on newline characters. The tool builds a small dynamic-programming table, walks back from the bottom-right cell, and labels each line as common, added, or removed. Added lines show a green background and a “+ ” prefix. Removed lines show a red background and a “− ” prefix. Unchanged lines stay plain. A line that you edited in place appears as one removal plus one addition, because the whole line no longer matches.
Worked example. Leave the sample texts in place: “This is the original text.” / “It has two lines.” versus “This is the changed text.” / “It has a second line.” Both first lines differ, so the first sample line is marked removed and the first revised line is marked added. The second lines also differ, so you see another red/green pair. If you then make the second lines identical, that pair collapses into one common line. That is the same idea as a simplified unified diff, without hunk headers or git blame.
Use this when you need a fast copy-edit pass, a config review, or a sanity check on JSON, SQL, or markdown before you commit. It is not a git client, not a binary file compare, and not a PDF or image diff. It will not merge conflicts or score a percentage match. For structured JSON, run the JSON formatter first so indentation noise does not drown the real change. For SQL, format the query, then diff. Secrets and production .env files do not belong on a shared screen even though the math stays local.
The controls match this article. Original Text is the left textarea (the default two-line sample). Changed Text is the right textarea. Differences is a monospace list under the boxes, not a two-column editor. There is no ignore-whitespace toggle, no word-level highlight, and no download button. Copy the surviving version back to your editor by hand. Related tools: JSON formatter, SQL formatter, and the word counter. Related guides cover developer productivity, JSON validation, and SQL formatting.
How to Use
- Paste version A into Original Text and version B into Changed Text. Keep the same line breaks you care about.
- Scan the Differences list. Green “+ ” lines were added; red “− ” lines were removed.
- Edit either box to re-run the compare instantly. There is no submit button.
- Copy the text you want to keep back into your editor. This page does not export a patch file.
- Close the tab when you are done. Nothing is stored on FlashKit or in localStorage.
Key Features
- Line-level LCS compare that updates as you type
- Green additions and red deletions with + / − prefixes
- Works for copy, configs, JSON, SQL, and markdown drafts
- No account, no compare quota, no upload
- Runs entirely in this browser tab
How the diff algorithm works
- Each side is split on \n. A blank line is still a line, so an extra newline shows up as an added or removed empty row.
- LCS finds the longest sequence of lines that appear in both texts in the same order. Everything else is classified as added or removed.
- There is no character-level or word-level pass. Changing one comma on a long line flags the entire line.
- Order matters. Swapping two lines looks like a delete plus an insert, not a move annotation.
- This is not Myers diff, not patience diff, and not git. Large files of many thousands of lines may feel slow because the table is O(n × m).
Common ways people use this diff checker
- Copy-editing a blog post or email: paste yesterday’s draft and today’s rewrite, then hunt accidental deletions.
- Config review: nginx, .env.example, or cron snippets where one missing line breaks production.
- JSON or SQL drafts after you format them — pair this page with the JSON validator and SQL formatter.
- Classroom or code-review teaching: show what actually changed without opening a git GUI.
- Legal or policy wording: compare two contract paragraphs as plain text, then finish in your word processor.
Limits, privacy, and tips
- Whitespace at the end of a line counts. Trim if you only care about words.
- There is no ignore-case option. “Hello” and “hello” are different lines.
- Do not paste customer data, passwords, or private keys on a projector. Local math is not the same as a private room.
- PDFs, Word files, and images are not compared. Extract text first, or use a desktop visual diff.
- Related FlashKit tools: JSON formatter, SQL formatter, word counter, PHP syntax checker. Guides: developer productivity, JSON validation, SQL formatting.
Frequently Asked Questions
Does the diff checker upload my text?
No. Both boxes and the LCS table live in this tab. Closing or refreshing the page drops the texts. Ads on the page are separate from the compare.
Is this the same as git diff?
No. It is a line-level longest-common-subsequence highlight in the browser. There are no commits, hunks, or blame. Use git for repositories; use this page for two pastes.
Can I diff images, PDFs, or Word files?
No. Convert to plain text first or use a desktop visual diff. This page only splits on newlines.
Why did a small edit flag the whole line?
The compare is line-based, not word-based. One changed character makes the old line “removed” and the new line “added”.
Can I ignore whitespace or case?
Not as a toggle. Normalize the texts in your editor (or with the word counter) before you paste if you want a cleaner compare.
Is there a limit on how much I can paste?
There is no FlashKit quota. Very large pastes can slow the tab because LCS is quadratic in the number of lines. Split huge files first.