Skip to main content
CodeLint.Dev Dev Tools

Prompt Diff — Compare Two Versions

Compare two prompt versions token by token to see exactly what changed between runs.

Prompt Diff / A-B Tester
Prompt A
Prompt B
A↔B

Enter text in both prompts to see differences

Additions shown in green · Deletions in red with strikethrough

Why diff at token level

A character-level diff tells you what you typed differently. A token-level diff tells you what the model saw differently, and those are not the same thing.

Adding a trailing space, changing a quotation mark from straight to curly, or reformatting an indent can re-tokenize a whole region — several tokens shift even though the visible text barely changed. Conversely, a rewrite that looks substantial may map to only a couple of token changes.

This matters most for prompt caching, which requires a byte-identical prefix. A single character inserted near the top of a long system prompt invalidates the cache for the entire prefix, and the first sign is usually a cost increase rather than an error. A token diff shows you exactly where the divergence begins.

Iterating on prompts without fooling yourself

  • Change one thing at a timeTwo simultaneous edits and an improved result tell you nothing about which edit helped, or whether one helped while the other hurt.
  • Test on more than one exampleA change that fixes your current case frequently breaks three others. Keep a fixed set of cases and run all of them.
  • Set temperature to 0 while iteratingOtherwise you cannot distinguish an improvement from sampling variance. Turn it back up afterwards if the task benefits.
  • Keep a changelogPrompts accumulate instructions added to fix specific incidents. Without a record of why each line exists, nobody dares remove anything and the prompt only grows.
  • Re-evaluate after a model upgradePrompts are tuned to a model. Instructions that were necessary for an older version are often redundant on a newer one — and occasionally counterproductive.

About

The Prompt Diff / A-B Tester shows a word-level diff between two prompts. Enter Prompt A and Prompt B, and the tool highlights every word that was added (green background) or removed (red strikethrough). Use it to understand exactly what changed between prompt iterations, compare different phrasings, or audit edits made to a system prompt.

How to use

  1. 1 Type or paste your first prompt into the "Prompt A" textarea.
  2. 2 Type or paste your second prompt into the "Prompt B" textarea.
  3. 3 The diff panel below updates instantly — green highlights show additions, red shows removals.
  4. 4 The stats bar shows character count, word count, and approximate token count for both prompts with delta values.
  5. 5 Click "Clear both" to reset.
What level does the diff operate at?
The diff is word-level — it splits text by whitespace and computes the longest common subsequence (LCS) between the two word lists. This produces a readable diff that shows meaningful changes. Character-level diffing can be noisy for prose; word-level is better for prompt comparison.
How is token count estimated?
Token count is approximated as character count ÷ 4, which is accurate for typical English prose. For exact token counts, use the Token Counter tool.
Can I use this to compare system prompt versions?
Yes — paste the old version in Prompt A and the new version in Prompt B. The diff makes it immediately clear what rules, constraints, or instructions were added, removed, or reworded. This is especially useful when debugging changed model behavior.