Skip to content

Comparison · Math

Claude vs Gemini for math

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 math prompts on all 5 Claude models and all 2 Gemini models and published every reply: the results, then Claude Haiku 4.5 against Gemini 3.8 Flash prompt by prompt, then how Claude and Gemini compare on price per message, context and files.

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

Short answer

In our math test runs on September 28, 2026, Claude's 5 models passed 25 of 25; 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 4.5 and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these math prompts don't split Claude and Gemini; the replies on this page show how they differ.

Claude and Gemini on our math test runs

Every Claude and Gemini model in llmwise on our 5 math prompts: how many replies passed, what each counted as on Pro, and what it cost to run.

Claude and Gemini on our math test runs
ModelPassedHard onesMessages used on ProCost per replyTime per reply
Claude Fable 5.1Anthropic5 of 52 of 21 each, of 31 a month on Pro$0.01164.6 s
Claude Opus 5.5Anthropic5 of 52 of 21 each, of 62 a month on Pro$0.00604.1 s
Claude Sonnet 5.5Anthropic5 of 52 of 21 each, of 125 a month on Pro$0.00251.7 s
Claude Sonnet 5Anthropic5 of 52 of 21 each, of 125 a month on Pro$0.00334.1 s
Claude Haiku 4.5Anthropic5 of 52 of 21 each, of 250 a month on Pro$0.00152.4 s
Gemini 3.1 Pro (preview)Google5 of 52 of 21 each, of 125 a month on Pro$0.01007.5 s
Gemini 3.8 FlashGoogle5 of 52 of 21 each, of 250 a month on Pro$0.00143.8 s
Claude: 25 of 25 replies passed; Gemini: 10 of 10 replies passed. Messages used is what each reply counted as on Pro; cost is what OpenRouter charged us per reply.

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 math prompt with Claude Haiku 4.5 and Gemini 3.8 Flash side by side, as they replied: for each side, the model that passed the most math prompts (then the most hard ones, then the cheaper).

Math: Claude Haiku 4.5 passed 5 of 5 and Gemini 3.8 Flash 5 of 5. Claude Haiku 4.5 answered 2.1× sooner at the median, 2.2 s against 4.7 s. They cost about the same, $0.0077 against $0.0071 for the 5 replies. Claude Haiku 4.5's replies ran 47% longer, in tokens of reply, thinking not counted.

  1. 1. A discount, then sales tax

    Everyday. Claude: 5 of 5 models passed, Claude Haiku 4.5 the cheapest at $0.0007 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0007. The prompt in full.

    Claude Haiku 4.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 4.5 answered sooner (1.1 s to 2.5 s), and Gemini 3.8 Flash's reply cost less ($0.0007 to $0.0007); Claude Haiku 4.5 wrote 63 tokens of reply, Gemini 3.8 Flash 89.

    • Claude Haiku 4.5

      Passed: Final answer 66: right.

      **Working:**
      
      1. Original price: $80
      2. Apply 25% discount: $80 × 0.75 = $60
      3. Add 10% sales tax: $60 × 1.10 = $66
      
      Final answer: $66

      429 tokens in, 63 out · 1.1 s · $0.0007 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

    • Gemini 3.8 Flash

      Passed: Final answer 66: right.

      1. Calculate the discount: $80 \times 0.25 = $20.
      2. Calculate the discounted price: $80 - $20 = $60.
      3. Calculate the sales tax: $60 \times 0.10 = $6.
      4. Calculate the total cost: $60 + $6 = $66.
      
      Final answer: $66

      430 tokens in, 89 out · 2.5 s · $0.0007 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·

  2. 2. Pens at 3 for $4

    Everyday. Claude: 5 of 5 models passed, Claude Haiku 4.5 the cheapest at $0.0014 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0017. The prompt in full.

    Claude Haiku 4.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 4.5 answered sooner (2.2 s to 4.7 s), and Claude Haiku 4.5's reply cost less ($0.0014 to $0.0017); Claude Haiku 4.5 wrote 199 tokens of reply, Gemini 3.8 Flash 114.

    • Claude Haiku 4.5

      Passed: Final answer Buy 3 packs of 3 pens and 1 single pen for 13.50: right.

      # Pen Purchase Problem
      
      **Option 1: Buy 3-packs only**
      - 10 pens ÷ 3 = 3 packs with 1 pen left over
      - 3 packs × $4 = $12
      - 1 single pen × $1.50 = $1.50
      - Total: $13.50
      
      **Option 2: Buy all single pens**
      - 10 pens × $1.50 = $15.00
      
      **Option 3: Buy 3 packs + adjust**
      - Same as Option 1: $13.50
      
      The cheapest way is to buy three 3-packs ($12) and one single pen ($1.50).
      
      Final answer: Buy 3 packs of 3 pens and 1 single pen for $13.50

      434 tokens in, 199 out · 2.2 s · $0.0014 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

    • Gemini 3.8 Flash

      Passed: Final answer 3 sets of 3 pens and 1 single pen for 13.50: right.

      To get exactly 10 pens at the lowest cost, buy as many 3-pen deals as possible:
      
      * 3 deals of 3 pens = 9 pens for $12.00 ($4.00 × 3)
      * 1 single pen = 1 pen for $1.50
      
      Total cost: $12.00 + $1.50 = $13.50
      
      Final answer: 3 sets of 3 pens and 1 single pen for $13.50

      431 tokens in, 354 out (240 of them reasoning) · 4.7 s · $0.0017 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·

  3. 3. Compound interest over three years

    Everyday. Claude: 5 of 5 models passed, Claude Haiku 4.5 the cheapest at $0.0013 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0009. The prompt in full.

    Claude Haiku 4.5 and Gemini 3.8 Flash both passed this one. Gemini 3.8 Flash answered sooner (2.1 s to 3.5 s), and Gemini 3.8 Flash's reply cost less ($0.0009 to $0.0013); Claude Haiku 4.5 wrote 173 tokens of reply, Gemini 3.8 Flash 148.

    • Claude Haiku 4.5

      Passed: Final answer 315.25: right.

      I'll calculate the compound interest for you.
      
      **Formula:** A = P(1 + r)^n
      
      Where:
      - P = Principal = $2,000
      - r = Annual interest rate = 0.05
      - n = Number of years = 3
      
      **Calculation:**
      - Year 1: $2,000 × 1.05 = $2,100.00
      - Year 2: $2,100 × 1.05 = $2,205.00
      - Year 3: $2,205 × 1.05 = $2,315.25
      
      **Interest earned:**
      $2,315.25 - $2,000.00 = $315.25
      
      Final answer: $315.25

      430 tokens in, 173 out · 3.5 s · $0.0013 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

    • Gemini 3.8 Flash

      Passed: Final answer 315.25: right.

      To find the total amount $A$ after 3 years:
      $A = P(1 + r)^t$
      $A = 2000 \times (1 + 0.05)^3$
      $A = 2000 \times (1.05)^3$
      $A = 2000 \times 1.157625 = 2315.25$
      
      To find the interest earned:
      $\text{Interest} = A - P = 2315.25 - 2000 = 315.25$
      
      Final answer: $315.25

      429 tokens in, 148 out · 2.1 s · $0.0009 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·

  4. 4. Four-digit numbers whose digits sum to 9

    Hard. Claude: 5 of 5 models passed, Claude Haiku 4.5 the cheapest at $0.0024 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0022. The prompt in full.

    Claude Haiku 4.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 4.5 answered sooner (2.9 s to 4.7 s), and Gemini 3.8 Flash's reply cost less ($0.0022 to $0.0024); Claude Haiku 4.5 wrote 404 tokens of reply, Gemini 3.8 Flash 235.

    • Claude Haiku 4.5

      Passed: Final answer 165: right.

      I need to find four-digit positive integers where the digits sum to 9.
      
      A four-digit positive integer has the form $\overline{abcd}$ where:
      - $a \in \{1,2,...,9\}$ (first digit can't be 0)
      - $b,c,d \in \{0,1,...,9\}$
      - $a + b + c + d = 9$
      
      **Method: Change of variables**
      
      Let $a' = a - 1$, so $a' \in \{0,1,...,8\}$.
      
      Then: $a' + 1 + b + c + d = 9$
      
      This gives: $a' + b + c + d = 8$
      
      Now I need to count non-negative integer solutions where:
      - $a' \in \{0,1,...,8\}$
      - $b,c,d \in \{0,1,...,9\}$
      - $a' + b + c + d = 8$
      
      Since the sum is only 8, each variable is automatically ≤ 8 (and thus $a' \leq 8$ and $b,c,d \leq 9$ are automatically satisfied).
      
      This is a standard stars and bars problem: distribute 8 identical objects into 4 distinct bins with no restrictions.
      
      The number of solutions is:
      $$\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = \frac{11 \times 10 \times 9}{3 \times 2 \times 1} = \frac{990}{6} = 165$$
      
      Final answer: 165

      404 tokens in, 404 out · 2.9 s · $0.0024 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

    • Gemini 3.8 Flash

      Passed: Final answer 165: right.

      Let the four digits be represented by $a, b, c,$ and $d$, where $a \in \{1, 2, \dots, 9\}$ and $b, c, d \in \{0, 1, \dots, 9\}$.
      
      We need to find the number of integer solutions to:
      $$a + b + c + d = 9$$
      
      Let $a' = a - 1$ so that $a' \ge 0$. Substituting gives:
      $$a' + b + c + d = 8$$
      
      Since the sum is $8$, no individual variable can exceed $8$, so the constraint that digits must be $\le 9$ is automatically satisfied.
      
      Using the stars and bars formula, the number of non-negative integer solutions is:
      $$\binom{8 + 4 - 1}{4 - 1} = \binom{11}{3} = \frac{11 \times 10 \times 9}{3 \times 2 \times 1} = 165$$
      
      Final answer: 165

      404 tokens in, 495 out (260 of them reasoning) · 4.7 s · $0.0022 · 1 message on Pro · answered by google/gemini-3.8-flash via Google ·

  5. 5. The highest of three dice is a 5

    Hard. Claude: 5 of 5 models passed, Claude Haiku 4.5 the cheapest at $0.0018 · Gemini: 2 of 2 models passed, Gemini 3.8 Flash the cheapest at $0.0018. The prompt in full.

    Claude Haiku 4.5 and Gemini 3.8 Flash both passed this one. Claude Haiku 4.5 answered sooner (2.2 s to 4.9 s), and cost about the same; Claude Haiku 4.5 wrote 276 tokens of reply, Gemini 3.8 Flash 172.

    • Claude Haiku 4.5

      Passed: Final answer 61/216: right.

      I need to find the probability that the maximum of three dice is exactly 5.
      
      **Working:**
      
      For the maximum to be exactly 5:
      - At least one die shows 5
      - No die shows 6
      
      **Count favorable outcomes:**
      - All three dice must show values from {1, 2, 3, 4, 5}
      - At least one die must show 5
      
      Using complementary counting:
      - Total ways to roll three dice with values in {1,2,3,4,5}: 5³ = 125
      - Ways with no 5 (all from {1,2,3,4}): 4³ = 64
      - Ways with at least one 5: 125 - 64 = 61
      
      **Total possible outcomes:** 6³ = 216
      
      **Probability:** 61/216
      
      Let me verify this is in lowest terms by checking if 61 and 216 share factors:
      - 61 is prime
      - 216 = 2³ × 3³
      - Since 61 is prime and doesn't equal 2 or 3, gcd(61, 216) = 1
      
      Final answer: 61/216

      420 tokens in, 276 out · 2.2 s · $0.0018 · 1 message on Pro · answered by anthropic/claude-haiku-4.5 via Amazon Bedrock ·

    • Gemini 3.8 Flash

      Passed: Final answer 61/216: right.

      To find the probability that the highest number showing on three fair six-sided dice is exactly 5:
      
      1. The total number of possible outcomes when rolling three dice is $6^3 = 216$.
      2. The number of outcomes where all three dice show a number less than or equal to 5 is $5^3 = 125$.
      3. The number of outcomes where all three dice show a number less than or equal to 4 (meaning no 5 is rolled) is $4^3 = 64$.
      4. The number of outcomes where the maximum number is exactly 5 is $125 - 64 = 61$.
      
      Thus, the probability is $\frac{61}{216}$.
      
      Final answer: 61/216

      421 tokens in, 392 out (220 of them reasoning) · 4.9 s · $0.0018 · 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 math prompts: passes, the median wait and what the replies cost. A lead under 10% counts as close.

How the math 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 math 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: 5 models, Claude Fable 5.1, Claude Opus 5.5, Claude Sonnet 5.5, Claude Sonnet 5, and Claude Haiku 4.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 4.5 (250 messages a month 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, Gemini 3.1 Pro (preview), and Gemini 3.8 Flash. 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 math?

In our math test runs on September 28, 2026, Claude's 5 models passed 25 of 25; 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 4.5 and Gemini 3.8 Flash each passed 5 of the 5 prompts, so these math 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 4.5 (250 messages a month on Pro), and the least expensive Gemini model is Gemini 3.8 Flash (250 messages a month on Pro). At API list prices (September 2026), a typical message of 4,000 tokens in and 700 out costs $0.0075 on Claude Haiku 4.5 and $0.0056 on Gemini 3.8 Flash.

Can I use Claude and Gemini in the same chat?

Yes. Ask Claude Haiku 4.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 4.5's answer included.

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.