What does this tool do?
Text Diff compares two texts line by line and shows in colour which lines were added, removed or left unchanged. It is handy for anyone comparing code versions, contract drafts, translation revisions or two configuration files.
How to use it
- Paste your text into the input area.
- Adjust the options to fit your needs.
- Copy the processed text.
Accurate alignment with an LCS algorithm
The tool uses a Longest Common Subsequence (LCS) based diff, which aligns shifted lines intelligently. When a new line is inserted in the middle, it marks only the genuinely new line as a green 'added' rather than flagging everything after it as changed. Removed lines appear in red and unchanged ones in a neutral colour. Each row carries its line number in both Text A and Text B, so you always know exactly where to look for a difference.
Summary counts and copyable diff
Above the result pane, the tool instantly counts how many lines were added, removed and left unchanged, for example '+3 added -2 removed'. This summary gives you the scale of the change between the two versions at a glance. The 'Copy Diff' button places the whole comparison on your clipboard, prefixing each line with '+', '-' or a space, a format that resembles what many code review tools and patches use.
Frequently asked questions
Is the comparison line-based or character-based?
The comparison is line-based. If a single word changes within a line, that line is shown as 'removed' in its old form and 'added' in its new form; there is no inline character-level highlighting.
What format does the copied diff use?
Added lines are prefixed with '+', removed lines with '-', and unchanged lines with two spaces. This resembles the unified patch format and can be pasted anywhere as plain text.
Does it detect whitespace and case differences?
Yes. The tool compares lines exactly, so even an extra space or a difference in capitalisation marks the line as changed. This is useful for catching subtle formatting edits.
Is Text Diff free?
Yes. Text Diff and all 300+ tools on MagmaNex are completely free with no signup or account required.
Is my data safe?
Yes. Everything runs locally in your browser. The data you enter is never sent to a server, stored, or shared.
Does it work on mobile?
Yes. Text Diff works on phones, tablets and desktops — no app download needed.
🔒 Privacy: everything runs in your browser, your data is never sent to a server.
