By Tim King · Updated
Prompt Diff
Line-by-Line Additions, Removals and Word-Level Changes Highlighted for System and LLM Prompt Versions
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Prompt Diff works
This prompt diff compares two versions of an AI prompt. Paste the old system prompt or instruction on one side and the new one on the other to see every added, removed and changed line, with the edited words highlighted, so you know exactly what changed between runs.
How the prompt diff works
Prompts evolve through many small edits, and when output quality shifts it is easy to lose track of which change caused it. The diff splits both versions into lines and finds the longest run of lines they share, the same method as the diff tools programmers use. Lines only in the old version are marked removed, lines only in the new one are marked added, and a line that was edited shows as the old line removed and the new line added, with the differing words highlighted.
The formula behind it is the longest common subsequence: lines shown as unchanged = the largest set of lines that appear in the same order in both versions, and everything else is an addition or removal. Ignore case and Ignore whitespace compare lines after lowercasing or removing spaces, hiding edits you do not care about.
First example. Changing "Answer in 100 words" to "Answer in 150 words" shows the old line removed and the new one added, with 100 and 150 highlighted.
Second example. Moving a rule from the end of the prompt to the start shows it removed in one place and added in the other.
How many changes is too many? Change one thing at a time when testing, so a single changed line explains any difference in the output.
How common prompt edits appear in the diff, and whether Ignore case or Ignore whitespace hides them
| Edit | How it shows | With Ignore case | With Ignore whitespace |
|---|---|---|---|
| Word changed | Old line removed, new line added, word highlighted | Shown | Shown |
| Word added | Old line removed, new line added, word highlighted | Shown | Shown |
| Sentence on a new line | Added line | Shown | Shown |
| Line deleted | Removed line | Shown | Shown |
| Line moved | Removed in one place, added in another | Shown | Shown |
| Two lines swapped | One removed and one added | Shown | Shown |
| Capital letter changed | Changed line | Hidden | Shown |
| ALL CAPS emphasis added | Changed line | Hidden | Shown |
| Double space to single | Changed line | Shown | Hidden |
| Tab indent to spaces | Changed line | Shown | Hidden |
| Trailing space added | Changed line | Shown | Hidden |
| Blank line added | Added line | Shown | Shown |
| Example swapped | Removed and added lines | Shown | Shown |
| Number changed (100 to 150) | Removed and added lines, number highlighted | Shown | Shown |
| Placeholder renamed | Changed lines | Shown | Shown |
| XML tag renamed | Changed lines at open and close | Shown | Shown |
| Markdown heading level changed | Changed line | Shown | Shown |
| Bullet style changed (- to *) | Changed lines | Shown | Shown |
| Punctuation changed | Changed line | Shown | Shown |
| Quote style changed (" to “) | Changed line | Shown | Shown |
| Whole section rewritten | Block of removed then added lines | Shown | Shown |
Tips and pitfalls
Keep prompts in version control or a dated file so you always have the old version to compare. One sentence per line makes diffs far easier to read. Watch for invisible edits: a changed quote style or a trailing space counts as a change, which is what the ignore options are for.
FAQ
Why diff prompts at all?
Small wording changes can shift a model's behaviour noticeably, and after several rounds of edits it is hard to remember what you changed. A diff gives a precise record, so you can link a change in output quality to the exact edit that caused it.
Can it compare long system prompts?
Yes. It handles prompts of many thousands of words, comparing line by line. Very long single-line prompts work too, but break them into one sentence per line first, since a change anywhere in a line marks the whole line as changed.
Does it compare the model's outputs too?
It compares any two texts, so you can paste two responses as well as two prompts. For outputs that are JSON, a JSON diff compares the structure rather than the lines, which ignores key order and formatting differences.
What do Ignore case and Ignore whitespace do?
Ignore case treats capital and lower-case letters as equal, so an edit that only changes capitals is not shown. Ignore whitespace removes spaces and tabs before comparing, hiding indentation and spacing edits, though blank lines still appear.
Is my prompt uploaded anywhere?
No. The comparison runs in your browser with JavaScript, so nothing you paste is sent to a server or stored. That makes it safe for confidential system prompts and internal instructions.
See also: all AI tools, Dev Utilities, Formatters & Validators, Data & Encoding, Security & Identifiers, SEO, Accessibility.
Related tools
Prompt Formatter
Turn loose notes into a structured prompt with XML tags or headings.
Text Diff
Compare two texts and see exactly what changed.
AI Token Counter
Count GPT tokens in a prompt or document with o200k_base, in your browser.
Markdown Cleaner
Strip Markdown from AI output and get clean plain text.
JSON Diff
Compare two JSON documents and list every change by path.