Comparison · Coding
ChatGPT vs Gemini for coding
On llmwise Pro, GPT-6.1 Sol gets up to 125 messages a month and Gemini 3.1 Pro (preview) up to 125 messages a month. ChatGPT is OpenAI's own app for its GPT models; llmwise has GPT models in its own chat, not ChatGPT itself. We ran the same 5 coding prompts on all 4 GPT models and all 2 Gemini models and published every reply: the results, then GPT-6 Luna against Gemini 3.8 Flash prompt by prompt, then how GPT and Gemini compare on price per message, context and files.
Based on 30 of our test runs on , through OpenRouter with the app's own prompt and settings. Updated .
Short answer
In our coding test runs on September 29, 2026, GPT's 4 models passed 20 of 20; GPT-6 Astra, GPT-6.1 Sol and 2 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. GPT-6 Luna and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these coding prompts don't split GPT and Gemini; the replies on this page show how they differ.
GPT and Gemini on our coding test runs
Every GPT 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 |
|---|---|---|---|---|---|
| GPT-6 AstraOpenAI | 5 of 5 | 2 of 2 | 1 each, of 31 a month on Pro | $0.0223 | 6.8 s |
| GPT-6.1 SolOpenAI | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0023 | 4.9 s |
| GPT-6 SolOpenAI | 5 of 5 | 2 of 2 | 1 each, of 125 a month on Pro | $0.0052 | 5.7 s |
| GPT-6 LunaOpenAI | 5 of 5 | 2 of 2 | 1 each, of 60 a day on Pro | $0.0003 | 4.9 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.
GPT vs Gemini, prompt by prompt
Each coding prompt with GPT-6 Luna 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: GPT-6 Luna passed 5 of 5 and Gemini 3.8 Flash 5 of 5. Their median waits were close, 4.6 s against 4.2 s. GPT-6 Luna cost 6.8× less, $0.0014 against $0.0098 for the 5 replies. Gemini 3.8 Flash's replies ran 72% longer, in tokens of reply, thinking not counted.
1. Turn a title into a URL slug
Everyday. GPT: 4 of 4 models passed, GPT-6 Luna the cheapest at $0.0001 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0009. The prompt in full.
GPT-6 Luna and Gemini 3.8 Flash both passed this one. GPT-6 Luna answered sooner (2.3 s to 4.2 s), and GPT-6 Luna's reply cost less ($0.0001 to $0.0009); GPT-6 Luna wrote 74 tokens of reply, Gemini 3.8 Flash 128.
GPT-6 Luna
Passed: All 7 tests passed.
```javascript function slugify(title) { return title .toLowerCase() .normalize("NFD") .replace(/[\u0300-\u036f]/g, "") .replace(/[^a-z0-9]+/g, "-") .replace(/^-|-$/g, ""); } ```483 tokens in, 74 out · 2.3 s · $0.0001 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
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. GPT: 4 of 4 models passed, GPT-6 Luna the cheapest at $0.0003 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0010. The prompt in full.
GPT-6 Luna and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (2.3 s to 4.6 s), and GPT-6 Luna's reply cost less ($0.0003 to $0.0010); GPT-6 Luna wrote 138 tokens of reply, Gemini 3.8 Flash 176.
GPT-6 Luna
Passed: All 10 tests passed.
```javascript function parseDuration(text) { if (typeof text !== "string") return null; const match = text.match(/^\s*(?:(\d+)h)?\s*(?:(\d+)m)?\s*(?:(\d+)s)?\s*$/); if (!match || !match[1] && !match[2] && !match[3]) return null; return Number(match[1] || 0) * 3600 + Number(match[2] || 0) * 60 + Number(match[3] || 0); } ```468 tokens in, 407 out (269 of them reasoning) · 4.6 s · $0.0003 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
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. GPT: 4 of 4 models passed, GPT-6 Luna the cheapest at $0.0001 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0012. The prompt in full.
GPT-6 Luna and Gemini 3.8 Flash both passed this one. GPT-6 Luna answered sooner (1.5 s to 3.8 s), and GPT-6 Luna's reply cost less ($0.0001 to $0.0012); GPT-6 Luna wrote 130 tokens of reply, Gemini 3.8 Flash 229.
GPT-6 Luna
Passed: All 7 tests passed.
```javascript function mergeIntervals(intervals) { const sorted = intervals .map(([start, end]) => [start, end]) .sort((a, b) => a[0] - b[0]); const merged = []; for (const [start, end] of sorted) { const last = merged[merged.length - 1]; if (!last || start > last[1]) { merged.push([start, end]); } else { last[1] = Math.max(last[1], end); } } return merged; } ```449 tokens in, 130 out · 1.5 s · $0.0001 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
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. GPT: 4 of 4 models passed, GPT-6 Luna the cheapest at $0.0006 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0045. The prompt in full.
GPT-6 Luna and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (6.7 s to 8.8 s), and GPT-6 Luna's reply cost less ($0.0006 to $0.0045); GPT-6 Luna wrote 552 tokens of reply, Gemini 3.8 Flash 1,070.
GPT-6 Luna
Passed: All 15 tests passed.
```javascript function evaluate(expression) { if (typeof expression !== "string") { throw new Error("Expression must be a string"); } let index = 0; function skipSpaces() { while (index < expression.length && /\s/.test(expression[index])) { index++; } } function parsePrimary() { skipSpaces(); if (expression[index] === "(") { index++; const value = parseExpression(); skipSpaces(); if (expression[index] !== ")") throw new Error("Missing closing parenthesis"); index++; return value; } const start = index; let digitsBefore = 0; while (/\d/.test(expression[index] || "")) { index++; digitsBefore++; } let digitsAfter = 0; if (expression[index] === ".") { index++; while (/\d/.test(expression[index] || "")) { index++; digitsAfter++; } } if (digitsBefore === 0 && digitsAfter === 0) { throw new Error("Expected a number or parenthesized expression"); } return Number(expression.slice(start, index)); } // Unary minus has lower precedence than exponentiation, but is allowed // on an exponent's right-hand side. function parseUnary() { skipSpaces(); if (expression[index] === "-") { index++; return -parseUnary(); } return parsePower(); } function parsePower() { let value = parsePrimary(); skipSpaces(); if (expression[index] === "^") { index++; value **= parseUnary(); } return value; } function parseProduct() { let value = parseUnary(); while (true) { skipSpaces(); const operator = expression[index]; if (operator !== "*" && operator !== "/") break; index++; const right = parseUnary(); value = operator === "*" ? value * right : value / right; } return value; } function parseExpression() { let value = parseProduct(); while (true) { skipSpaces(); const operator = expression[index]; if (operator !== "+" && operator !== "-") break; index++; const right = parseProduct(); value = operator === "+" ? value + right : value - right; } return value; } const result = parseExpression(); skipSpaces(); if (index !== expression.length) throw new Error("Unexpected input"); return result; } ```549 tokens in, 1,007 out (455 of them reasoning) · 8.8 s · $0.0006 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
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. GPT: 4 of 4 models passed, GPT-6 Luna the cheapest at $0.0004 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0022. The prompt in full.
GPT-6 Luna and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (5.0 s to 7.2 s), and GPT-6 Luna's reply cost less ($0.0004 to $0.0022); GPT-6 Luna wrote 315 tokens of reply, Gemini 3.8 Flash 480.
GPT-6 Luna
Passed: All 8 tests passed.
```javascript function parseCsv(text) { if (text === "") return []; const rows = []; let row = []; let field = ""; let inQuotes = false; let endedWithRowBreak = false; for (let i = 0; i < text.length; i++) { const char = text[i]; if (inQuotes) { if (char === '"') { if (text[i + 1] === '"') { field += '"'; i++; } else { inQuotes = false; } } else { field += char; } endedWithRowBreak = false; continue; } if (char === '"' && field === "") { inQuotes = true; endedWithRowBreak = false; } else if (char === ",") { row.push(field); field = ""; endedWithRowBreak = false; } else if (char === "\n" || (char === "\r" && text[i + 1] === "\n")) { row.push(field); rows.push(row); row = []; field = ""; if (char === "\r") i++; endedWithRowBreak = true; } else { field += char; endedWithRowBreak = false; } } if (!endedWithRowBreak) { row.push(field); rows.push(row); } return rows; } ```481 tokens in, 762 out (447 of them reasoning) · 7.2 s · $0.0004 · 1 message on Pro · answered by openai/gpt-6-luna via OpenAI ·
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 GPT model against each Gemini model
Every GPT 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.
GPT-6 Astra vs Gemini 3.1 Pro: 5 of 5 each; GPT-6 Astra answered 1.3× sooner at the median and Gemini 3.1 Pro cost 1.1× less.
GPT-6 Astra vs Gemini 3.8 Flash: 5 of 5 each; Gemini 3.8 Flash answered 2.0× sooner at the median and cost 11.4× less.
GPT-6.1 Sol vs Gemini 3.1 Pro: 5 of 5 each; GPT-6.1 Sol answered 2.2× sooner at the median and cost 8.5× less.
GPT-6.1 Sol vs Gemini 3.8 Flash: 5 of 5 each; Gemini 3.8 Flash answered 1.1× sooner at the median and cost 1.2× less.
GPT-6 Sol vs Gemini 3.1 Pro: 5 of 5 each; GPT-6 Sol answered 2.1× sooner at the median and cost 3.7× less. GPT-6 Sol vs Gemini 3.1 Pro (preview), on every job.
GPT-6 Sol vs Gemini 3.8 Flash: 5 of 5 each; Gemini 3.8 Flash answered 1.1× sooner at the median and cost 2.7× less. GPT-6 Sol vs Gemini 3.8 Flash, on every job.
GPT-6 Luna vs Gemini 3.1 Pro: 5 of 5 each; GPT-6 Luna answered 2.2× sooner at the median and cost 67.9× less.
GPT-6 Luna vs Gemini 3.8 Flash: 5 of 5 each; they took about as long and GPT-6 Luna cost 6.8× less. GPT-6 Luna vs Gemini 3.8 Flash, on every job.
How the coding replies are scored
Every GPT 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
GPT: 4 models, GPT-6 Astra, GPT-6.1 Sol, GPT-6 Sol, and GPT-6 Luna. Gemini: 2 models, Gemini 3.1 Pro (preview) and Gemini 3.8 Flash.
Price per message
The least expensive GPT model is GPT-6 Luna (60 messages a day on Pro); the least expensive Gemini model is Gemini 3.8 Flash (250 messages a month on Pro).
Context window
GPT goes up to 1.05M tokens (GPT-6 Astra); 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 GPT-6.1 Sol, GPT-6 Sol, GPT-6 Luna, Gemini 3.1 Pro (preview), and Gemini 3.8 Flash. Paid plans have every model, with messages every month.
Every GPT and Gemini model's context window, files and API price: ChatGPT vs Gemini.
Where your messages go
In llmwise, a message to GPT 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, ChatGPT or Gemini for coding?
In our coding test runs on September 29, 2026, GPT's 4 models passed 20 of 20; GPT-6 Astra, GPT-6.1 Sol and 2 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. GPT-6 Luna and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these coding prompts don't split GPT and Gemini; the replies on this page show how they differ.
Is GPT or Gemini cheaper?
In llmwise, the least expensive GPT model is GPT-6 Luna (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 GPT-6 Luna and $0.0056 on Gemini 3.8 Flash.
Can I use GPT and Gemini in the same chat?
Yes. Ask GPT-6 Luna a question, then switch the picker to Gemini 3.8 Flash and ask again: Gemini 3.8 Flash sees the whole conversation, GPT-6 Luna'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.