Gemini 3.1 Pro · Coding
Gemini 3.1 Pro for coding: our test runs
Gemini 3.1 Pro ran our 5 coding prompts in llmwise, through the same pipeline your messages take. Here's every reply as it came, whether it passed, what it cost and what it counts as on Pro, next to the other models.
Based on 5 of our test runs on , through OpenRouter with the app's own prompt and settings. Updated .
Short answer
In our test runs on September 27, 2026, Gemini 3.1 Pro passed 5 of 5 of our coding prompts (both hard ones): tied 1st of 15 models. Each reply counted as 1 message on Pro, where it has 125 a month, and cost $0.0195 to run on average.
Prompt by prompt
Each of the 5 coding prompts, and how Gemini 3.1 Pro's reply did.
| Prompt | Result | Cost | Time |
|---|---|---|---|
| Turn a title into a URL slugEveryday | Passed: All 7 tests passed. | $0.0056 | 6.0 s |
| Parse a duration like “1h 30m”Everyday | Passed: All 10 tests passed. | $0.0172 | 10.3 s |
| Merge overlapping intervalsEveryday | Passed: All 7 tests passed. | $0.0103 | 8.6 s |
| Evaluate an arithmetic expression, no evalHard | Passed: All 15 tests passed. | $0.0351 | 20.6 s |
| Parse CSV with quoted fieldsHard | Passed: All 8 tests passed. | $0.0291 | 20.6 s |
Every coding reply from Gemini 3.1 Pro
Turn a title into a URL slug
An everyday prompt: “Turn a title into a URL slug”, in full.
Passed: All 7 tests passed.
```javascript function slugify(title) { return title .normalize('NFD') .replace(/[\u0300-\u036f]/g, '') .toLowerCase() .replace(/[^a-z0-9]+/g, '-') .replace(/^-+|-+$/g, ''); } ```514 tokens in, 380 out (299 of them reasoning) · 6.0 s · $0.0056 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
Parse a duration like “1h 30m”
An everyday prompt: “Parse a duration like “1h 30m””, in full.
Passed: All 10 tests passed.
```javascript function parseDuration(text) { if (typeof text !== 'string' || text.trim() === '') { return null; } const regex = /^\s*(?:(\d+)\s*h)?\s*(?:(\d+)\s*m)?\s*(?:(\d+)\s*s)?\s*$/; const match = text.match(regex); if (!match) { return null; } const hours = match[1] ? parseInt(match[1], 10) : 0; const minutes = match[2] ? parseInt(match[2], 10) : 0; const seconds = match[3] ? parseInt(match[3], 10) : 0; if (hours === 0 && minutes === 0 && seconds === 0 && !match[1] && !match[2] && !match[3]) { return null; } return (hours * 3600) + (minutes * 60) + seconds; } ```498 tokens in, 1,348 out (1,095 of them reasoning) · 10.3 s · $0.0172 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
Merge overlapping intervals
An everyday prompt: “Merge overlapping intervals”, in full.
Passed: All 7 tests passed.
```javascript function mergeIntervals(intervals) { if (!intervals || intervals.length === 0) { return []; } const sorted = [...intervals].sort((a, b) => a[0] - b[0]); const result = []; let current = [sorted[0][0], sorted[0][1]]; for (let i = 1; i < sorted.length; i++) { const next = sorted[i]; if (next[0] <= current[1]) { current[1] = Math.max(current[1], next[1]); } else { result.push(current); current = [next[0], next[1]]; } } result.push(current); return result; } ```477 tokens in, 780 out (584 of them reasoning) · 8.6 s · $0.0103 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
Evaluate an arithmetic expression, no eval
A hard prompt: “Evaluate an arithmetic expression, no eval”, in full.
Passed: All 15 tests passed.
```javascript function evaluate(expression) { let pos = 0; function peek() { while (pos < expression.length && expression[pos] === ' ') { pos++; } return pos < expression.length ? expression[pos] : null; } function parseExpr() { let left = parseTerm(); while (true) { let char = peek(); if (char === '+' || char === '-') { pos++; let right = parseTerm(); if (char === '+') left += right; else left -= right; } else { break; } } return left; } function parseTerm() { let left = parseFactor(); while (true) { let char = peek(); if (char === '*' || char === '/') { pos++; let right = parseFactor(); if (char === '*') left *= right; else left /= right; } else { break; } } return left; } function parseFactor() { let char = peek(); if (char === '-') { pos++; return -parseFactor(); } return parsePower(); } function parsePower() { let left = parsePrimary(); let char = peek(); if (char === '^') { pos++; let right = parseFactor(); return Math.pow(left, right); } return left; } function parsePrimary() { let char = peek(); if (char === null) { throw new Error("Unexpected end of expression"); } if (char === '(') { pos++; let val = parseExpr(); if (peek() !== ')') { throw new Error("Missing closing parenthesis"); } pos++; return val; } let match = expression.slice(pos).match(/^\d+(\.\d+)?/); if (!match) { throw new Error(`Invalid character at position ${pos}`); } pos += match[0].length; return parseFloat(match[0]); } let result = parseExpr(); if (peek() !== null) { throw new Error(`Unexpected character at position ${pos}`); } return result; } ```587 tokens in, 2,831 out (2,262 of them reasoning) · 20.6 s · $0.0351 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
Parse CSV with quoted fields
A hard prompt: “Parse CSV with quoted fields”, in full.
Passed: All 8 tests passed.
```javascript function parseCsv(text) { if (text === "") return []; const rows = []; let currentRow = []; let currentField = ""; let inQuotes = false; for (let i = 0; i < text.length; i++) { const c = text[i]; if (inQuotes) { if (c === '"') { if (i + 1 < text.length && text[i + 1] === '"') { currentField += '"'; i++; // Skip escaped quote } else { inQuotes = false; } } else { currentField += c; } } else { if (c === '"' && currentField === "") { inQuotes = true; } else if (c === ',') { currentRow.push(currentField); currentField = ""; } else if (c === '\r' && i + 1 < text.length && text[i + 1] === '\n') { currentRow.push(currentField); rows.push(currentRow); currentRow = []; currentField = ""; i++; // Skip \n } else if (c === '\n') { currentRow.push(currentField); rows.push(currentRow); currentRow = []; currentField = ""; } else { currentField += c; } } } // If the text didn't end with a newline, push the final field and row. // We also push if the very last character was a comma (meaning an empty field at the end). if (currentField !== "" || currentRow.length > 0 || (text.length > 0 && text[text.length - 1] === ',')) { currentRow.push(currentField); rows.push(currentRow); } return rows; } ```515 tokens in, 2,339 out (1,877 of them reasoning) · 20.6 s · $0.0291 · 1 message on Pro · answered by google/gemini-3.1-pro-preview via Google ·
How it compares on coding
Gemini 3.1 Pro beside the job's picks among every model. 13 models share the hard-problems pick, Gemini 3.1 Pro among them.
| Model | Passed | On Pro | Cost per reply |
|---|---|---|---|
| GLM 5.3Our pick: hard problems (shared), best value | 5 of 5 | 250 a month on Pro | $0.0015 |
| GLM 5.3 FlashOur pick: hard problems (shared), everyday | 5 of 5 | 60 a day on Pro | $0.0003 |
| Gemini 3.1 ProOur pick: hard problems (shared) | 5 of 5 | 125 a month on Pro | $0.0195 |
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.
How these runs were done
Tests. Automatic. The function runs against the prompt's tests in a separate Node.js process with a time limit and no file, network or child-process access; it passes when every test passes.
Gemini 3.1 Pro, and coding, elsewhere
- Gemini 3.1 Pro: price, limits and messages on every plan
- The best AI for coding: our picks among every model
- Gemini for coding
- Gemini 3.1 Pro for writing: our test runs
- Gemini 3.1 Pro for math: our test runs
- Gemini 3.1 Pro for data analysis: our test runs
- Analyze a CSV with code: the prompt, and its price
- Our test runs: 50 prompts on every model
Questions
Is Gemini 3.1 Pro good for coding?
In our test runs it passed 5 of 5 coding prompts, tied 1st of the 15 models in llmwise. Every reply is on this page, so you can judge them yourself.
How many of my messages does a coding reply from Gemini 3.1 Pro use?
1 message each on Pro, where it has 125 a month on Pro. The price of a message is fixed and shown before you send it, however long the reply.
How were these runs done?
The same way for every model: each prompt sent through llmwise's own pipeline, each reply checked the same way. The methods page has every prompt and how each is scored.
Claude, GPT, Gemini, DeepSeek, Grok, Kimi, and GLM, 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.