Comparison · Coding
Claude vs Gemini for coding
On llmwise Pro, Claude Sonnet 5.5 gets up to 125 messages a month and Gemini 3.1 Pro (preview) up to 125 messages a month. We ran the same 5 coding prompts on all 6 Claude models and all 2 Gemini models and published every reply: the results, then Claude Haiku 5.5 against Gemini 3.8 Flash prompt by prompt, then how Claude and Gemini compare on price per message, context and files.
Based on 40 of our test runs on , through OpenRouter with the app's own prompt and settings. Updated .
Short answer
In our coding test runs on October 7, 2026, Claude's 6 models passed 28 of 30; Claude Fable 5.1, Claude Opus 5.5 and 3 more each passed 5 of 5. Gemini's 2 models passed 10 of 10; Gemini 3.1 Pro and Gemini 3.8 Flash each passed 5 of 5. Claude Haiku 5.5 and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these coding prompts don't split Claude and Gemini; the replies on this page show how they differ.
Claude and Gemini on our coding test runs
Every Claude and Gemini model in llmwise on our 5 coding prompts: how many replies passed, what each counted as on Pro, and what it cost to run.
| Model | Passed | Hard ones | Messages used on Pro | Cost per reply | Time per reply |
|---|---|---|---|---|---|
| Claude Fable 5.1Anthropic | 5 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0425 | 9.1 s |
| Claude Opus 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 62 a month on Pro | $0.0171 | 8.3 s |
| Claude Sonnet 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0063 | 3.0 s |
| Claude Sonnet 5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0102 | 8.0 s |
| Claude Haiku 4.5Anthropic | 3 of 5 | 0 of 2 | 1 each, of 250 a month on Pro | $0.0027 | 3.4 s |
| Claude Haiku 5.5Anthropic | 5 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0005 | 4.0 s |
| Gemini 3.1 Pro (preview)Google | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0195 | 13.2 s |
| Gemini 3.8 FlashGoogle | 5 of 5 | 2 of 2 | 1 each, of 250 a month on Pro | $0.0020 | 4.4 s |
Every limit is published. Paid plans also have a monthly fair-use limit on AI cost: Pro $7.50, Max $20, Ultra $42, Studio $85. Using every message on your plan at typical sizes stays under it; very large messages and heavy research use it faster. Every limit, explained.
Claude vs Gemini, prompt by prompt
Each coding prompt with Claude Haiku 5.5 and Gemini 3.8 Flash side by side, as they replied: for each side, the model that passed the most coding prompts (then the most hard ones, then the cheaper).
Coding: Claude Haiku 5.5 passed 5 of 5 and Gemini 3.8 Flash 5 of 5. Their median waits were close, 3.9 s against 4.2 s. Claude Haiku 5.5 cost 4.3× less, $0.0023 against $0.0098 for the 5 replies. Their replies ran to about the same length.
1. Turn a title into a URL slug
Everyday. Claude: 6 of 6 models passed, Claude Haiku 5.5 the cheapest at $0.0001 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0009. The prompt in full.
Claude Haiku 5.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 5.5 answered sooner (1.5 s to 4.2 s), and Claude Haiku 5.5's reply cost less ($0.0001 to $0.0009); Claude Haiku 5.5 wrote 112 tokens of reply, Gemini 3.8 Flash 128.
Claude Haiku 5.5
Passed: All 7 tests passed.
```javascript function slugify(title) { return String(title) .normalize("NFD") .replace(/[\u0300-\u036f]/g, "") .toLowerCase() .replace(/[^a-z0-9]+/g, "-") .replace(/^-+|-+$/g, ""); } ```672 tokens in, 112 out · 1.5 s · $0.0001 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
Gemini 3.8 Flash
Passed: All 7 tests passed.
```javascript function slugify(title) { return title .normalize('NFD') // Decompose combined graphemes into base letters + diacritical marks .replace(/[\u0300-\u036f]/g, '') // Remove all diacritical marks .toLowerCase() .replace(/[^a-z0-9]+/g, '-') // Replace runs of non-alphanumeric characters with a single hyphen .replace(/^-+|-+$/g, ''); // Trim leading and trailing hyphens } ```514 tokens in, 128 out · 4.2 s · $0.0009 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
2. Parse a duration like “1h 30m”
Everyday. Claude: 6 of 6 models passed, Claude Haiku 5.5 the cheapest at $0.0005 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0010. The prompt in full.
Claude Haiku 5.5 and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (2.3 s to 5.4 s), and Claude Haiku 5.5's reply cost less ($0.0005 to $0.0010); Claude Haiku 5.5 wrote 180 tokens of reply, Gemini 3.8 Flash 176.
Claude Haiku 5.5
Passed: All 10 tests passed.
```javascript function parseDuration(text) { if (typeof text !== 'string') return null; const m = /^\s*(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?\s*$/.exec(text); if (!m || m.slice(1).every(v => v === undefined)) return null; const [, h = 0, mi = 0, s = 0] = m; return Number(h) * 3600 + Number(mi) * 60 + Number(s); } ```627 tokens in, 868 out (688 of them reasoning) · 5.4 s · $0.0005 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
Gemini 3.8 Flash
Passed: All 10 tests passed.
```javascript function parseDuration(text) { if (typeof text !== 'string') return null; const match = text.trim().match(/^(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?$/); if (!match || (!match[1] && !match[2] && !match[3])) { return null; } const hours = match[1] ? Number(match[1]) : 0; const minutes = match[2] ? Number(match[2]) : 0; const seconds = match[3] ? Number(match[3]) : 0; return hours * 3600 + minutes * 60 + seconds; } ```498 tokens in, 176 out · 2.3 s · $0.0010 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
3. Merge overlapping intervals
Everyday. Claude: 6 of 6 models passed, Claude Haiku 5.5 the cheapest at $0.0002 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0012. The prompt in full.
Claude Haiku 5.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 5.5 answered sooner (1.3 s to 3.8 s), and Claude Haiku 5.5's reply cost less ($0.0002 to $0.0012); Claude Haiku 5.5 wrote 185 tokens of reply, Gemini 3.8 Flash 229.
Claude Haiku 5.5
Passed: All 7 tests passed.
```javascript function mergeIntervals(intervals) { const sorted = intervals .map(([start, end]) => [start, end]) .sort((a, b) => a[0] - b[0] || a[1] - b[1]); const merged = []; for (const [start, end] of sorted) { const last = merged[merged.length - 1]; if (last && start <= last[1]) { last[1] = Math.max(last[1], end); } else { merged.push([start, end]); } } return merged; } ```622 tokens in, 185 out · 1.3 s · $0.0002 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
Gemini 3.8 Flash
Passed: All 7 tests passed.
```javascript function mergeIntervals(intervals) { if (!intervals || intervals.length <= 1) { return intervals ? intervals.map(interval => [...interval]) : []; } // Clone and sort by start time, breaking ties by end time const sorted = intervals .map(interval => [...interval]) .sort((a, b) => a[0] - b[0] || a[1] - b[1]); const merged = [sorted[0]]; for (let i = 1; i < sorted.length; i++) { const current = sorted[i]; const lastMerged = merged[merged.length - 1]; // Overlapping or touching intervals if (current[0] <= lastMerged[1]) { lastMerged[1] = Math.max(lastMerged[1], current[1]); } else { merged.push(current); } } return merged; } ```477 tokens in, 229 out · 3.8 s · $0.0012 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
4. Evaluate an arithmetic expression, no eval
Hard. Claude: 5 of 6 models passed, Claude Haiku 5.5 the cheapest at $0.0006 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0045. The prompt in full.
Claude Haiku 5.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 5.5 answered sooner (3.9 s to 6.7 s), and Claude Haiku 5.5's reply cost less ($0.0006 to $0.0045); Claude Haiku 5.5 wrote 1,074 tokens of reply, Gemini 3.8 Flash 1,070.
Claude Haiku 5.5
Passed: All 15 tests passed.
```javascript function evaluate(expression) { const s = String(expression); const tokens = []; let i = 0; while (i < s.length) { const c = s[i]; if (c === ' ' || c === '\t' || c === '\n' || c === '\r') { i++; continue; } if ((c >= '0' && c <= '9') || c === '.') { let j = i; while (j < s.length && ((s[j] >= '0' && s[j] <= '9') || s[j] === '.')) j++; const text = s.slice(i, j); if (!/^(\d+\.?\d*|\.\d+)$/.test(text)) throw new Error(`Invalid number "${text}"`); tokens.push({ type: 'num', value: Number(text) }); i = j; continue; } if ('+-*/^()'.includes(c)) { tokens.push({ type: c }); i++; continue; } throw new Error(`Unexpected character "${c}"`); } let pos = 0; const peek = () => tokens[pos] ? tokens[pos].type : null; const next = () => tokens[pos++]; // expr := term (('+'|'-') term)* function parseExpr() { let value = parseTerm(); while (peek() === '+' || peek() === '-') { const op = next().type; const rhs = parseTerm(); value = op === '+' ? value + rhs : value - rhs; } return value; } // term := unary (('*'|'/') unary)* function parseTerm() { let value = parseUnary(); while (peek() === '*' || peek() === '/') { const op = next().type; const rhs = parseUnary(); value = op === '*' ? value * rhs : value / rhs; } return value; } // unary := '-' unary | power function parseUnary() { if (peek() === '-') { next(); return -parseUnary(); } return parsePower(); } // power := primary ('^' unary)? (right-associative; exponent may be signed) function parsePower() { const base = parsePrimary(); if (peek() === '^') { next(); const exp = parseUnary(); return Math.pow(base, exp); } return base; } // primary := number | '(' expr ')' function parsePrimary() { const t = tokens[pos]; if (!t) throw new Error('Unexpected end of expression'); if (t.type === 'num') { pos++; return t.value; } if (t.type === '(') { pos++; const value = parseExpr(); if (peek() !== ')') throw new Error('Expected ")"'); pos++; return value; } throw new Error(`Unexpected token "${t.type}"`); } if (tokens.length === 0) throw new Error('Empty expression'); const result = parseExpr(); if (pos !== tokens.length) throw new Error(`Unexpected token "${tokens[pos].type}"`); return result; } ```763 tokens in, 1,074 out · 3.9 s · $0.0006 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
Gemini 3.8 Flash
Passed: All 15 tests passed.
```javascript function evaluate(expression) { // Tokenize the expression const tokens = []; let i = 0; const n = expression.length; while (i < n) { const ch = expression[i]; if (/\s/.test(ch)) { i++; continue; } if (/[0-9.]/.test(ch)) { let start = i; let dotCount = 0; while (i < n && /[0-9.]/.test(expression[i])) { if (expression[i] === '.') dotCount++; i++; } if (dotCount > 1) { throw new Error(`Invalid number format at index ${start}`); } const numStr = expression.slice(start, i); if (numStr === '.') { throw new Error(`Invalid single dot at index ${start}`); } tokens.push({ type: 'NUMBER', value: parseFloat(numStr) }); continue; } if ('+-*/^()'.includes(ch)) { tokens.push({ type: ch, value: ch }); i++; continue; } throw new Error(`Unexpected character '${ch}' at index ${i}`); } let pos = 0; function peek() { return tokens[pos]; } function consume(expectedType) { const token = tokens[pos]; if (!token || (expectedType && token.type !== expectedType)) { throw new Error(`Unexpected token at position ${pos}`); } pos++; return token; } // Grammar with precedence: // Expr -> AddSub // AddSub -> MulDiv (('+' | '-') MulDiv)* // MulDiv -> Unary (('*' | '/') Unary)* // Unary -> '-' Unary | Power // Power -> Primary ('^' (Unary | Power))? -- right associative, handles 2^-1 and -2^2 // Primary -> NUMBER | '(' Expr ')' function parseExpr() { return parseAddSub(); } function parseAddSub() { let left = parseMulDiv(); while (pos < tokens.length && (tokens[pos].type === '+' || tokens[pos].type === '-')) { const op = consume().type; const right = parseMulDiv(); left = op === '+' ? left + right : left - right; } return left; } function parseMulDiv() { let left = parseUnary(); while (pos < tokens.length && (tokens[pos].type === '*' || tokens[pos].type === '/')) { const op = consume().type; const right = parseUnary(); if (op === '/') { left = left / right; } else { left = left * right; } } return left; } function parseUnary() { if (pos < tokens.length && tokens[pos].type === '-') { consume('-'); return -parseUnary(); } if (pos < tokens.length && tokens[pos].type === '+') { consume('+'); return parseUnary(); } return parsePower(); } function parsePower() { let left = parsePrimary(); if (pos < tokens.length && tokens[pos].type === '^') { consume('^'); // Right-hand side allows unary minus (e.g. 2^-1) or another power const right = parseUnary(); return Math.pow(left, right); } return left; } function parsePrimary() { const token = peek(); if (!token) { throw new Error('Unexpected end of input'); } if (token.type === 'NUMBER') { consume('NUMBER'); return token.value; } if (token.type === '(') { consume('('); const val = parseExpr(); consume(')'); return val; } throw new Error(`Unexpected token '${token.value}' at position ${pos}`); } if (tokens.length === 0) { throw new Error('Empty expression'); } const result = parseExpr(); if (pos < tokens.length) { throw new Error(`Unexpected token at position ${pos}`); } return result; } ```587 tokens in, 1,070 out · 6.7 s · $0.0045 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
5. Parse CSV with quoted fields
Hard. Claude: 5 of 6 models passed, Claude Haiku 5.5 the cheapest at $0.0008 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0022. The prompt in full.
Claude Haiku 5.5 and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (5.0 s to 8.1 s), and Claude Haiku 5.5's reply cost less ($0.0008 to $0.0022); Claude Haiku 5.5 wrote 516 tokens of reply, Gemini 3.8 Flash 480.
Claude Haiku 5.5
Passed: All 8 tests passed.
```javascript function parseCsv(text) { const rows = []; if (text === '') return rows; let row = []; let field = ''; let inQuotes = false; let fieldStart = true; // true only at the very beginning of a field let i = 0; const n = text.length; while (i < n) { const c = text[i]; if (inQuotes) { if (c === '"') { if (text[i + 1] === '"') { field += '"'; i += 2; } else { inQuotes = false; i++; } } else { field += c; i++; } continue; } if (c === '"' && fieldStart) { inQuotes = true; fieldStart = false; i++; continue; } if (c === ',') { row.push(field); field = ''; fieldStart = true; i++; continue; } if (c === '\n' || c === '\r') { row.push(field); rows.push(row); row = []; field = ''; fieldStart = true; if (c === '\r' && text[i + 1] === '\n') i += 2; else i++; continue; } field += c; fieldStart = false; i++; } // Flush the last row unless the text ended with a line break if (row.length > 0 || field !== '' || !fieldStart) { row.push(field); rows.push(row); } return rows; } ```670 tokens in, 1,464 out (948 of them reasoning) · 8.1 s · $0.0008 · 1 message on Pro · answered by anthropic/claude-haiku-5.5 via Anthropic ·
Gemini 3.8 Flash
Passed: All 8 tests passed.
```javascript function parseCsv(text) { if (text === '') return []; // Remove a single trailing newline if present if (text.endsWith('\r\n')) { text = text.slice(0, -2); } else if (text.endsWith('\n')) { text = text.slice(0, -1); } if (text === '') return []; const rows = []; let currentRow = []; let currentField = ''; let inQuotes = false; let isStartOfField = true; for (let i = 0; i < text.length; i++) { const char = text[i]; if (inQuotes) { if (char === '"') { if (text[i + 1] === '"') { currentField += '"'; i++; // skip escaped quote } else { inQuotes = false; } } else { currentField += char; } } else { if (isStartOfField && char === '"') { inQuotes = true; isStartOfField = false; } else if (char === ',') { currentRow.push(currentField); currentField = ''; isStartOfField = true; } else if (char === '\r' && text[i + 1] === '\n') { currentRow.push(currentField); rows.push(currentRow); currentRow = []; currentField = ''; isStartOfField = true; i++; // skip '\n' } else if (char === '\n') { currentRow.push(currentField); rows.push(currentRow); currentRow = []; currentField = ''; isStartOfField = true; } else { currentField += char; isStartOfField = false; } } } currentRow.push(currentField); rows.push(currentRow); return rows; } ```515 tokens in, 480 out · 5.0 s · $0.0022 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·
Each Claude model against each Gemini model
Every Claude model against every Gemini model on the same 5 coding prompts: passes, the median wait and what the replies cost. A lead under 10% counts as close.
Claude Fable 5.1 vs Gemini 3.1 Pro: 5 of 5 each; Claude Fable 5.1 answered 1.9× sooner at the median and Gemini 3.1 Pro cost 2.2× less.
Claude Fable 5.1 vs Gemini 3.8 Flash: 5 of 5 each; Gemini 3.8 Flash answered 1.3× sooner at the median and cost 21.8× less.
Claude Opus 5.5 vs Gemini 3.1 Pro: 5 of 5 each; Claude Opus 5.5 answered 1.4× sooner at the median and cost 1.1× less. Claude Opus 5.5 vs Gemini 3.1 Pro (preview), on every job.
Claude Opus 5.5 vs Gemini 3.8 Flash: 5 of 5 each; Gemini 3.8 Flash answered 1.7× sooner at the median and cost 8.7× less.
Claude Sonnet 5.5 vs Gemini 3.1 Pro: 5 of 5 each; Claude Sonnet 5.5 answered 5.2× sooner at the median and cost 3.1× less. Claude Sonnet 5.5 vs Gemini 3.1 Pro (preview), on every job.
Claude Sonnet 5.5 vs Gemini 3.8 Flash: 5 of 5 each; Claude Sonnet 5.5 answered 2.1× sooner at the median and Gemini 3.8 Flash cost 3.2× less.
Claude Sonnet 5 vs Gemini 3.1 Pro: 5 of 5 each; Claude Sonnet 5 answered 3.8× sooner at the median and cost 1.9× less. Claude Sonnet 5 vs Gemini 3.1 Pro (preview), on every job.
Claude Sonnet 5 vs Gemini 3.8 Flash: 5 of 5 each; Claude Sonnet 5 answered 1.6× sooner at the median and Gemini 3.8 Flash cost 5.2× less. Claude Sonnet 5 vs Gemini 3.8 Flash, on every job.
Claude Haiku 4.5 vs Gemini 3.1 Pro: Claude Haiku 4.5 3 of 5, Gemini 3.1 Pro 5; Claude Haiku 4.5 answered 4.4× sooner at the median and cost 7.1× less. Claude Haiku 4.5 vs Gemini 3.1 Pro (preview), on every job.
Claude Haiku 4.5 vs Gemini 3.8 Flash: Claude Haiku 4.5 3 of 5, Gemini 3.8 Flash 5; Claude Haiku 4.5 answered 1.8× sooner at the median and Gemini 3.8 Flash cost 1.4× less. Claude Haiku 4.5 vs Gemini 3.8 Flash, on every job.
Claude Haiku 5.5 vs Gemini 3.1 Pro: 5 of 5 each; Claude Haiku 5.5 answered 2.6× sooner at the median and cost 43.0× less.
Claude Haiku 5.5 vs Gemini 3.8 Flash: 5 of 5 each; they took about as long and Claude Haiku 5.5 cost 4.3× less.
How the coding replies are scored
Every Claude and Gemini reply above was checked the same way as every other model's, by the rules published with the prompts: how the coding prompts are scored, and each one in full.
The differences at a glance
What follows from each model's facts in our catalog.
The lineups
Claude: 6 models, Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 4.5, and Claude Haiku 5.5. Gemini: 2 models, Gemini 3.1 Pro (preview) and Gemini 3.8 Flash.
Price per message
The least expensive Claude model is Claude Haiku 5.5 (60 messages a day on Pro); the least expensive Gemini model is Gemini 3.8 Flash (250 messages a month on Pro).
Context window
Claude goes up to 1M tokens (Claude Fable 5.1); Gemini up to 1.05M tokens (Gemini 3.1 Pro (preview)).
Images and PDFs
Every model here reads images. Every model here takes a PDF as a whole file.
On the Free plan
Free's one-time trial of 5 messages covers Claude Sonnet 5.5, Claude Sonnet 5, Claude Haiku 4.5, Claude Haiku 5.5, Gemini 3.1 Pro (preview), and Gemini 3.8 Flash, and Claude Opus 5.5 for 1 message. Paid plans have every model, with messages every month.
Every Claude and Gemini model's context window, files and API price: Claude vs Gemini.
Where your messages go
In llmwise, a message to Claude or Gemini goes to the model's maker, or through OpenRouter when llmwise can't reach the maker directly. The Privacy Policy has the details.
Questions
Which is better, Claude or Gemini for coding?
In our coding test runs on October 7, 2026, Claude's 6 models passed 28 of 30; Claude Fable 5.1, Claude Opus 5.5 and 3 more each passed 5 of 5. Gemini's 2 models passed 10 of 10; Gemini 3.1 Pro and Gemini 3.8 Flash each passed 5 of 5. Claude Haiku 5.5 and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these coding prompts don't split Claude and Gemini; the replies on this page show how they differ.
Is Claude or Gemini cheaper?
In llmwise, the least expensive Claude model is Claude Haiku 5.5 (60 messages a day on Pro), and the least expensive Gemini model is Gemini 3.8 Flash (250 messages a month on Pro). At API list prices (October 2026), a typical message of 4,000 tokens in and 700 out costs $0.0008 on Claude Haiku 5.5 and $0.0056 on Gemini 3.8 Flash.
Can I use Claude and Gemini in the same chat?
Yes. Ask Claude Haiku 5.5 a question, then switch the picker to Gemini 3.8 Flash and ask again: Gemini 3.8 Flash sees the whole conversation, Claude Haiku 5.5's answer included.
Claude, GPT, Gemini, DeepSeek, Grok, Kimi, GLM, and Mistral, in one chat.
See what a message costs before you send it. Free is 5 messages to try; sign in with an email link, no password or card.