Skip to content

Gemini · Coding

Gemini for coding

llmwise has 5 of Google's Gemini models, from Gemini 3.8 Flash (up to 250 messages a month on Pro) to Gemini 4 Carbon (up to 62 messages a month). We ran the same coding prompts on every one and published every reply: which Gemini model to use, from the results, what each costs per message, and how to get more out of it.

Based on 25 of our test runs on , through OpenRouter with the app's own prompt and settings.

Short answer

In our test runs on November 18, 2026, all 5 models passed 5 of 5 coding prompts, so these prompts don't pick one for hard problems. For value, Gemini 3.8 Flash (5 of 5), 250 a month on Pro. It's also our pick for everyday.

Our picks for coding

  • Hard problems

    Shared by 5 models

    All 5 models passed 5 of 5, both hard ones: Gemini 4 Carbon, Gemini 4 Argon, Gemini 4 Hydrogen and 2 more. These prompts don't tell them apart, so they share the pick.

  • Best value

    Gemini 3.8 Flash

    Passed 5 of 5 coding prompts, with 250 a month on Pro.

  • Everyday

    Gemini 3.8 Flash

    Passed 5 of 5 coding prompts, at 250 a month on Pro. The same model as best value.

These picks aren't our opinion: they're what the results below give, by these rules, among the Gemini models in llmwise. They change when the results do.

  • Hard problems: the model that passed the most prompts and, of those, the most hard ones. Models level on both share the pick: the prompts don't tell them apart, so we don't break the tie by price or by name.
  • Best value: among the models that draw on the monthly allowance, the one with the most messages on Pro that passed no more than one prompt fewer than the top model. Ties go to the one that passed more, then to the lower cost per reply.
  • Everyday: among the cheapest models on the page (the everyday models, which come from the daily count, when the page has any), the one that passed the most. Ties go to the one that passed more of the hard prompts, then to the lower cost per reply.

Our coding test runs, model by model

How each model did on our 5 coding prompts, what each reply counted as on Pro, and what it cost to run.

Our coding test runs
ModelPassedHard onesMessages used on ProCost per replyTime per reply
Gemini 4 CarbonGoogle5 of 52 of 21 each, of 62 a month on Pro$0.014137.0 s
Gemini 4 ArgonGoogle5 of 52 of 21 each, of 62 a month on Pro$0.00268.8 s
Gemini 4 HydrogenGoogle5 of 52 of 21 each, of 125 a month on Pro$0.00617.9 s
Gemini 3.1 Pro (preview)Google5 of 52 of 21 each, of 125 a month on Pro$0.013115.8 s
Gemini 3.8 FlashGoogle5 of 52 of 21 each, of 250 a month on Pro$0.00114.4 s
Passed: out of the job's 5 prompts, how many replies passed their check (a reply the provider failed to give isn't counted). Messages used: what each reply counted as on Pro, and Pro's count on the model. Cost: what OpenRouter charged us per reply, on average; in llmwise you pay per message, not per token. Time: from sending to the whole reply.

One prompt, side by side

Each model's reply to “Evaluate an arithmetic expression, no eval”, as it came, with whether it passed and what it cost.

The prompt: Evaluate an arithmetic expression, no eval (hard)
Write a JavaScript function evaluate(expression) that computes an arithmetic expression given as a string and returns the number.
It supports numbers like 3, 0.5 and 12.25; the operators + - * / and ^ (power); parentheses; unary minus; and spaces anywhere.
- ^ binds tighter than unary minus and is right-associative, so -2^2 is -4 and 2^3^2 is 512. A unary minus may follow ^, as in 2^-1, which is 0.5.
- * and / bind tighter than + and -. Otherwise operators of the same level go left to right, so 8/4/2 is 1.
- Throw an Error for input that isn't a valid expression, such as "2 +", "(1" or "1 2".
Don't use eval, Function or any library.
Reply with the whole function in one ```javascript code block: plain JavaScript for Node.js 22, no imports, no TypeScript.
  • Gemini 4 Carbon

    Passed: All 15 tests passed.

    ```javascript
    function evaluate(expression) {
      if (typeof expression !== "string") {
        throw new Error("Expression must be a string");
      }
    
      const tokens = [];
      let i = 0;
      const n = expression.length;
    
      while (i < n) {
        const ch = expression[i];
    
        if (ch === " " || ch === "\t" || ch === "\n" || ch === "\r") {
          i++;
          continue;
        }
    
        if (
          ch === "+" ||
          ch === "-" ||
          ch === "*" ||
          ch === "/" ||
          ch === "^" ||
          ch === "(" ||
          ch === ")"
        ) {
          tokens.push({ type: "op", value: ch });
          i++;
          continue;
        }
    
        if (ch >= "0" && ch <= "9") {
          const start = i;
          while (i < n && expression[i] >= "0" && expression[i] <= "9") {
            i++;
          }
          if (i < n && expression[i] === ".") {
            i++;
            if (i >= n || expression[i] < "0" || expression[i] > "9") {
              throw new Error(`Invalid number at position ${start}`);
            }
            while (i < n && expression[i] >= "0" && expression[i] <= "9") {
              i++;
            }
          }
          tokens.push({ type: "num", value: Number(expression.slice(start, i)) });
          continue;
        }
    
        throw new Error(`Unexpected character "${ch}" at position ${i}`);
      }
    
      let pos = 0;
    
      function peek() {
        return tokens[pos];
      }
    
      function consume() {
        return tokens[pos++];
      }
    
      // Expr := AddSub
      function parseExpr() {
        return parseAddSub();
      }
    
      // AddSub := MulDiv (('+' | '-') MulDiv)*
      function parseAddSub() {
        let left = parseMulDiv();
        while (
          peek() &&
          peek().type === "op" &&
          (peek().value === "+" || peek().value === "-")
        ) {
          const op = consume().value;
          const right = parseMulDiv();
          left = op === "+" ? left + right : left - right;
        }
        return left;
      }
    
      // MulDiv := Unary (('*' | '/') Unary)*
      function parseMulDiv() {
        let left = parseUnary();
        while (
          peek() &&
          peek().type === "op" &&
          (peek().value === "*" || peek().value === "/")
        ) {
          const op = consume().value;
          const right = parseUnary();
          left = op === "*" ? left * right : left / right;
        }
        return left;
      }
    
      // Unary := '-' Unary | Power
      function parseUnary() {
        if (peek() && peek().type === "op" && peek().value === "-") {
          consume();
          return -parseUnary();
        }
        return parsePower();
      }
    
      // Power := Primary ('^' Unary)?
      function parsePower() {
        const base = parsePrimary();
        if (peek() && peek().type === "op" && peek().value === "^") {
          consume();
          const exponent = parseUnary();
          return base ** exponent;
        }
        return base;
      }
    
      // Primary := Number | '(' Expr ')'
      function parsePrimary() {
        const tok = peek();
        if (!tok) {
          throw new Error("Unexpected end of expression");
        }
    
        if (tok.type === "num") {
          consume();
          return tok.value;
        }
    
        if (tok.type === "op" && tok.value === "(") {
          consume();
          const val = parseExpr();
          const closing = peek();
          if (!closing || closing.type !== "op" || closing.value !== ")") {
            throw new Error("Missing closing parenthesis");
          }
          consume();
          return val;
        }
    
        throw new Error(`Unexpected token "${tok.value}"`);
      }
    
      const result = parseExpr();
      if (pos !== tokens.length) {
        throw new Error(`Unexpected token "${tokens[pos].value}"`);
      }
    
      return result === 0 ? 0 : result;
    }
    ```

    809 tokens in, 3,355 out (2,305 of them reasoning) · 53.6 s · $0.0176 · 1 message on Pro · answered by google/gemini-4-carbon via Google AI Studio ·

  • Gemini 3.8 Flash

    Passed: All 15 tests passed.

    ```javascript
    function evaluate(expression) {
      // Tokenize the input string
      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 numStr = '';
          let dotCount = 0;
          while (i < n && /[0-9.]/.test(expression[i])) {
            if (expression[i] === '.') {
              dotCount++;
              if (dotCount > 1) {
                throw new Error(`Invalid number format at index ${i}`);
              }
            }
            numStr += expression[i];
            i++;
          }
          if (numStr === '.') {
            throw new Error(`Invalid number '.' at index ${i - 1}`);
          }
          tokens.push({ type: 'NUMBER', value: parseFloat(numStr) });
          continue;
        }
    
        if ('+-*/^()'.includes(ch)) {
          tokens.push({ type: 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(`Expected '${expectedType}', found '${token ? token.type : 'EOF'}'`);
        }
        pos++;
        return token;
      }
    
      // Expression grammar:
      // parseAddSub: handles + and - (left-associative)
      // parseMulDiv: handles * and / (left-associative)
      // parseUnary:  handles unary + and -
      // parsePower:  handles ^ (right-associative, tighter than unary minus)
      // parsePrimary: numbers, parentheses, or unary after ^ (e.g., 2^-1)
    
      function parseExpression() {
        return parseAddSub();
      }
    
      function parseAddSub() {
        let left = parseMulDiv();
        while (pos < tokens.length) {
          const next = peek();
          if (next && (next.type === '+' || next.type === '-')) {
            consume();
            const right = parseMulDiv();
            left = next.type === '+' ? left + right : left - right;
          } else {
            break;
          }
        }
        return left;
      }
    
      function parseMulDiv() {
        let left = parseUnary();
        while (pos < tokens.length) {
          const next = peek();
          if (next && (next.type === '*' || next.type === '/')) {
            consume();
            const right = parseUnary();
            if (next.type === '/') {
              left = left / right;
            } else {
              left = left * right;
            }
          } else {
            break;
          }
        }
        return left;
      }
    
      function parseUnary() {
        const next = peek();
        if (next && (next.type === '+' || next.type === '-')) {
          consume();
          const operand = parsePower();
          return next.type === '-' ? -operand : operand;
        }
        return parsePower();
      }
    
      function parsePower() {
        let left = parsePrimary();
        const next = peek();
        if (next && next.type === '^') {
          consume();
          // Right-associative: recursively evaluate the exponent
          // Also allows unary operators on the exponent directly, e.g. 2^-1
          const right = parsePowerOperand();
          left = Math.pow(left, right);
        }
        return left;
      }
    
      function parsePowerOperand() {
        const next = peek();
        if (next && (next.type === '+' || next.type === '-')) {
          consume();
          const val = parsePower();
          return next.type === '-' ? -val : val;
        }
        return parsePower();
      }
    
      function parsePrimary() {
        const token = peek();
        if (!token) {
          throw new Error('Unexpected end of expression');
        }
    
        if (token.type === 'NUMBER') {
          consume();
          return token.value;
        }
    
        if (token.type === '(') {
          consume('(');
          const val = parseExpression();
          consume(')');
          return val;
        }
    
        throw new Error(`Unexpected token '${token.type}'`);
      }
    
      if (tokens.length === 0) {
        throw new Error('Empty expression');
      }
    
      const result = parseExpression();
    
      if (pos < tokens.length) {
        throw new Error(`Unexpected token '${tokens[pos].type}' at end of expression`);
      }
    
      return result;
    }
    ```

    782 tokens in, 1,188 out · 8.7 s · $0.0025 · 1 message on Pro · answered by google/gemini-3.8-flash via Google AI Studio ·

  • Gemini 4 Hydrogen

    Passed: All 15 tests passed.

    ```javascript
    function evaluate(expression) {
      if (typeof expression !== "string") {
        throw new Error("Expression must be a string");
      }
    
      let pos = 0;
      const len = expression.length;
    
      function skipSpaces() {
        while (pos < len && /\s/.test(expression[pos])) {
          pos++;
        }
      }
    
      function peek() {
        skipSpaces();
        return pos < len ? expression[pos] : null;
      }
    
      function parseExpression() {
        let value = parseTerm();
        while (true) {
          const op = peek();
          if (op === "+" || op === "-") {
            pos++;
            const right = parseTerm();
            value = op === "+" ? value + right : value - right;
          } else {
            break;
          }
        }
        return value;
      }
    
      function parseTerm() {
        let value = parseUnary();
        while (true) {
          const op = peek();
          if (op === "*" || op === "/") {
            pos++;
            const right = parseUnary();
            value = op === "*" ? value * right : value / right;
          } else {
            break;
          }
        }
        return value;
      }
    
      function parseUnary() {
        if (peek() === "-") {
          pos++;
          return -parseUnary();
        }
        return parsePower();
      }
    
      function parsePower() {
        const base = parsePrimary();
        if (peek() === "^") {
          pos++;
          const exponent = parseUnary();
          return base ** exponent;
        }
        return base;
      }
    
      function parsePrimary() {
        const ch = peek();
        if (ch === null) {
          throw new Error("Unexpected end of expression");
        }
    
        if (ch === "(") {
          pos++;
          const value = parseExpression();
          if (peek() !== ")") {
            throw new Error("Expected closing parenthesis");
          }
          pos++;
          return value;
        }
    
        const slice = expression.slice(pos);
        const match = /^(?:\d+(?:\.\d+)?|\.\d+)/.exec(slice);
        if (match) {
          pos += match[0].length;
          return Number(match[0]);
        }
    
        throw new Error(`Unexpected character '${ch}' at position ${pos}`);
      }
    
      const result = parseExpression();
      if (peek() !== null) {
        throw new Error(`Unexpected character '${peek()}' at position ${pos}`);
      }
      return result;
    }
    ```

    809 tokens in, 2,733 out (2,116 of them reasoning) · 13.4 s · $0.0109 · 1 message on Pro · answered by google/gemini-4-hydrogen via Google AI Studio ·

The coding prompts, and how they're scored

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.

Each prompt was sent the way llmwise sends a message in a side-by-side comparison, which offers no tools: the app's own system prompt, the model's own settings, and Pro's reply size limit (8,000 tokens). Read all five coding prompts and how every reply was scored.

Prompts like these to try yourself

Gemini in llmwise

Gemini models in llmwise
ModelOn ProPlansContext windowImagesPDFsReasoningAPI price per 1M, in / out
Gemini 4 CarbonGoogle62/mo on ProPlus and Pro1.05M tokensYesWhole fileYes$4.00 / $20.00
Gemini 4 ArgonGoogle62/mo on ProPlus and Pro1.05M tokensYesWhole fileYes$4.00 / $20.00
Gemini 4 HydrogenGoogle125/mo on ProPlus and Pro1.05M tokensYesWhole fileYes$1.50 / $7.50
Gemini 3.1 Pro (preview)Google125/mo on ProPlus and Pro1.05M tokensYesWhole fileYes$2.00 / $12.00
Gemini 3.8 FlashGoogle250/mo on ProPlus and Pro1.05M tokensYesWhole fileYes$0.75 / $3.75
Each badge is how many messages Pro gets on the model: a month’s, or a day’s on an everyday model. “Plans” says which plans have the model. “Text only” models get the text of a PDF, not the file. API prices are the per-token prices in our model catalog as of October 2026 (Google: Google's list price). In llmwise you pay per message, not per token. Gemini 4 Carbon: its standard price from December 1, 2026; $2 / $10 until then. Gemini 4 Argon: its standard price from December 1, 2026; $2 / $10 until then. Gemini 3.1 Pro (preview): the standard rate, for prompts up to 200K tokens. Gemini 3.8 Flash: an introductory price, through December 31, 2026.

Every limit is published. Paid plans also have a monthly fair-use limit on AI cost: Plus $3.75, 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.

What matters for coding

  • Room for your code

    The more of your code a model can take in at once, the fewer details it has to guess. Context windows are listed below.

  • Reasoning on hard problems

    Models that reason before answering tend to do better on problems with several moving parts, like a bug that crosses files.

  • Running the code

    Code that has been run beats code that looks right. A model that can run and test its own code catches its own mistakes.

  • Cost per try

    Coding means many small tries. A cheap model for quick questions and a stronger one for the hard ones keeps the cost down.

Gemini for coding in llmwise

  • Code opens as a document

    Ask for a script or a component and it opens beside the chat as a code document that keeps every version, so you can step back to an earlier one.

  • Run code (Pro and higher plans)

    On Pro and higher plans the model can run Python or Node.js in an isolated sandbox once you approve it, read the output and fix what failed. A run counts as 1 Claude Haiku 4.5 message and stops after 60 seconds.

  • HTML apps run in the chat

    Ask for a calculator, a small tool or a page and it runs live as an HTML app in the side panel.

  • Switch models mid-chat

    Start on a cheaper model; if the answer isn't good enough, switch models in the same chat. The next model sees the whole conversation, so you don't paste anything twice.

In llmwise, a message to Gemini goes to its maker, Google, or through OpenRouter when llmwise can't reach the maker directly. See the Privacy Policy.

Tips

  • Paste the exact error and the code that produced it, not just a description.

  • Say which language, version and libraries you use.

  • For a big change, ask for a plan first, then one step at a time.

  • Pick the Coder persona for code-first answers that explain their trade-offs.

  • If a model gets stuck, switch to another in the same chat: it sees the code so far.

Questions

Is Gemini good for coding?

In our test runs on November 18, 2026, Gemini 4 Carbon passed 5 of 5, Gemini 4 Argon passed 5 of 5, Gemini 4 Hydrogen passed 5 of 5, Gemini 3.1 Pro (preview) passed 5 of 5, Gemini 3.8 Flash passed 5 of 5 of our coding prompts, against a best result of 5 of 5 among all 27 models. Every reply is published on this page and the methods page, so you can judge them yourself.

Which Gemini model should I use for coding?

Start with Gemini 3.8 Flash for most day-to-day coding: writing functions, explaining code, reviewing a change, and move up to Gemini 4 Carbon for large refactors, subtle bugs and design questions where a wrong answer costs you hours.

Can I use Gemini for coding for free?

No: there's no free plan or trial. Gemini 4 Carbon, Gemini 4 Argon, Gemini 4 Hydrogen, Gemini 3.1 Pro (preview), and Gemini 3.8 Flash are all on Plus and Pro. Paid monthly from the day you start. Cancel in two clicks in Settings → Billing.

Can llmwise run the code it writes?

On Pro and higher plans, yes. The model writes Python or Node.js, you approve the run, and it executes in an isolated sandbox with no internet access except package registries, stopping after 60 seconds. It reads the output and can fix what failed. Each run counts as 1 Claude Haiku 4.5 message.

Claude, GPT, Gemini, DeepSeek, Grok, Kimi, GLM, and Mistral, in one chat.

See what a message costs before you send it. Every plan is month to month: cancel in two clicks. Sign in with an email link, no password.