Claude essentials

Why Is AI Bad at Math? (And the Fix: Let It Write the Formula)

Why is AI bad at math? Chatbots predict tokens, they don't calculate. How accurate ChatGPT and Claude really are, and the fix: let AI write the formula or code.

Claude essentials

On this page

AI chatbots are bad at math because they don't calculate anything. A language model like ChatGPT or Claude writes its answer one small chunk of text (a "token") at a time, picking whatever is most likely to come next based on patterns it learned. It never sees your numbers as numbers, only as chunks of digits, and it doesn't run a calculator unless it's given one. That's why it can explain compound interest beautifully and then get the total wrong. The fix is simple and it's the whole point of this guide: language models are bad at arithmetic and expensive when they reason, but cheap and good at reading documents. So let the AI read and write (pull out the numbers, write the formula, the SQL or the code) and let a calculator, Excel, a database or code do the math.

TL;DR

QuestionShort answer
Why is AI bad at math?It predicts the next token instead of computing. Numbers get split into chunks of up to 3 digits that don't line up with ones, tens and hundreds, so long arithmetic falls apart.
Can ChatGPT do math?It can explain math and set up problems well. Its head-arithmetic on long numbers isn't reliable unless it runs code.
Is Claude good at math?Same story. Claude is good at reasoning about a problem, and reliable on the actual arithmetic when code execution is turned on and it calculates with code.
Is ChatGPT accurate?There's no single accuracy number. It depends on the task, the model and whether search or tools are on. Details below.
What's the fix?Ask for the formula, not the answer. Turn on code execution. Ask for SQL or a pivot. Extract documents to a table first, then calculate. Always check the totals.

If you want to see the token problem with your own eyes, paste some numbers into our free token counter and watch how they get chopped up.

Why AI is bad at math: three reasons

1. It sees tokens, not numbers

Before a model reads anything, your text gets cut into tokens: chunks of text that might be a whole word, part of a word, or a few digits. (Our explainer on what tokens are in AI covers this in plain English.)

Numbers get cut up in a way that has nothing to do with how you learned math. We ran a few through OpenAI's open-source tokenizer (the one used by GPT-4o and GPT-5 class models):

123456789                ->  123 | 456 | 789
3.14159                  ->  3 | . | 141 | 59
12345 * 6789 = 83810205  ->  123 | 45 | * | 678 | 9 | = | 838 | 102 | 05

Look at the last line. "12345" becomes "123" and "45". "6789" becomes "678" and "9". The chunks are cut from the left, in groups of up to three digits, so they don't line up with place value. When you multiply on paper, you start from the ones column and carry. The model never gets a ones column. It gets "123" and "45" and has to guess its way to the right digits.

A 2024 study by Singh and Strouse found that forcing numbers to be chunked from the right instead (they did it by adding comma separators, like 12,345) led to "largely improved performance" on arithmetic, and that the errors under normal chunking followed predictable patterns. In other words, part of the problem really is how the numbers are sliced.

2. It predicts, it doesn't compute

Anthropic describes Claude's underlying model as "pretrained to predict the next word." That's the core of it. When you ask "what's 4,817 times 3,962?", the model isn't doing long multiplication. It's producing the digits that look most likely to come next, based on everything it has seen.

For small, common sums (7 times 8, 15 percent of 200) the pattern is so well worn that the prediction is almost always right. For a number it has never seen before, there's no pattern to lean on. The answer will look right, with the right number of digits and a plausible start, and still be wrong in the middle.

3. Longer numbers get worse, fast

The best-known measurement of this is the "Faith and Fate" paper from 2023. The researchers found that GPT-4 got 3-digit by 3-digit multiplication right only 59% of the time, and 4-digit by 4-digit only 4% of the time. Letting it work step by step on a scratchpad raised the 3-digit score from 59% to 92%, which tells you the steps help but don't make it a calculator.

Two honest caveats. Those are GPT-4 numbers from 2023. Today's reasoning models do much better, because they work through the problem step by step or quietly run code. And nobody has published a verified 2026 figure I'd trust enough to quote. But the shape of the problem hasn't changed: every extra digit is another chance to slip, and the model can't feel when it's slipped.

The cousin problem: counting, word limits and exact lists

The same weakness shows up anywhere you need an exact count:

  • "How many r's are in strawberry?" (the famous one: here's why AI couldn't count the r's in strawberry)
  • "Write exactly 150 words."
  • "Keep this under 280 characters."
  • "Give me exactly 25 product names."
  • "How many times does 'refund' appear in these emails?"

Models produce tokens, not words or characters, so they don't have a running word or character count in their head. Research on letter counting (Fu and colleagues, 2024) found models can recognize the letters but struggle to count them, especially when a letter repeats. Counting repeated things is its own weak spot, on top of the token issue.

What to do: if a limit actually matters (an ad headline, a form field, a contract clause count), count it with a tool. Paste the text into a word counter, the token counter, or ask the AI to count it with code (more on that below). Don't trust "Here are your 150 words."

Is ChatGPT accurate? Is Claude good at math?

Here's what the honest numbers say, as of October 2026. I'm not going to crown a winner, because the sources don't support one.

There's no single "ChatGPT is X% accurate" number. Anyone quoting one is making it up. Accuracy depends on what you ask, which model you're using, and whether it can search the web or run code.

What we do have:

SourceWhat it measuresWhat it found
OpenAI's GPT-5 system card (Aug 2025)Hard fact questions with short answers (SimpleQA), no web accessEven the best GPT-5 variant answered correctly about 55% of the time. GPT-4o was at 44%.
Same system cardReal ChatGPT traffic with browsing onShare of incorrect claims dropped to single digits for GPT-5 (4.5% for the thinking model, 9.6% for the main model). GPT-4o was 12.9%.
Vectara hallucination leaderboard (updated Sep 2026)Only whether a model adds facts that aren't in a document it's summarizingMost major models land roughly between 3% and 12%. OpenAI, Google and Anthropic models are spread across that range.

How to read that:

  • On hard trivia from memory, even strong models are wrong a lot. The SimpleQA test is deliberately tough, but it shows that a confident answer is not a checked answer.
  • Search and tools cut errors sharply. The same model gets much more accurate when it can look things up. Math works the same way: give it a calculator (code) and the arithmetic stops being a guess.
  • The Vectara board is about summarizing, not math or general knowledge. It's useful for "will it stick to my document?", not "is it good at math?" Also, the newest Claude 5.x models aren't on it yet as of this check, so don't let anyone tell you it measured them.

So, is Claude good at math? Claude is good at the parts of math that are really reading and reasoning: understanding a word problem, picking the right formula, setting up a spreadsheet, spotting that your margin calculation uses the wrong denominator. For the raw arithmetic, treat it like any other language model. Turn on code execution, ask it to calculate with code, and it's as reliable as the code it runs. The same goes for ChatGPT with its data analysis feature.

Can AI do math? Yes, when it's allowed to use the right tool. That's the fix.

The fix: let AI write the formula, and let something else do the math

Here's the playbook I use. The rule behind every step: AI reads and writes. Excel, a database or code executes.

1. Ask for the formula, not the answer

This is the single biggest habit change. Instead of "what's my total?", ask for the formula and paste it into Excel or Google Sheets. The spreadsheet does the arithmetic perfectly, every time, and you can see exactly how the number was made.

Prompt:

I have a sheet with these columns: A = Date, B = Customer, C = Invoice amount,
D = Amount paid, E = Status ("Paid", "Partial", "Open").
Rows 2 to 400. Don't calculate anything yourself.
Write me Excel formulas for:
1. Total still owed across all invoices
2. Total owed by customer "Acme Co"
3. Number of invoices that are "Open" and older than 30 days
Explain each formula in one sentence.

What you'll get back looks like this:

=SUM(C2:C400)-SUM(D2:D400)
=SUMIFS(C2:C400,B2:B400,"Acme Co")-SUMIFS(D2:D400,B2:B400,"Acme Co")
=COUNTIFS(E2:E400,"Open",A2:A400,"<"&TODAY()-30)

If you just need one formula fast, our free Excel formula generator does exactly this, no sign-in. If you live in spreadsheets, read Claude for Excel: the add-in works inside your workbook and writes real formulas into real cells.

2. Turn on code execution and ask it to calculate with code

When you can't use a spreadsheet, make the AI use a calculator. In claude.ai, code execution is available on every plan, Free included. To turn it on: Settings > Capabilities > Code execution and file creation. (On Team and Enterprise it's on by default, and your owner controls it.) ChatGPT has the equivalent in its data analysis feature, depending on your plan and model.

Then say so explicitly:

Use code to calculate this. Don't do the math in your head.
I'm borrowing $38,500 at 7.25% APR for 60 months.
Calculate the monthly payment, total interest, and show the first
6 rows of the amortization schedule. Show me the code you ran.

"Show me the code you ran" matters. It forces the calculation into an actual program, and it gives you something you (or a friend who codes) can check.

3. For data, ask for SQL or a pivot

If your numbers live in a database, a CRM export or a big CSV, don't paste 5,000 rows and ask for a total. Ask for the query.

I have a table called orders with columns: order_id, customer_id,
order_date, total, refunded (true/false).
Write a SQL query for monthly revenue in 2026, excluding refunded orders,
with the number of orders per month. Don't run it or guess the results.
SELECT
  DATE_TRUNC('month', order_date) AS month,
  COUNT(*) AS orders,
  SUM(total) AS revenue
FROM orders
WHERE refunded = false
  AND order_date >= '2026-01-01'
  AND order_date < '2027-01-01'
GROUP BY 1
ORDER BY 1;

Not a SQL person? Same idea in a spreadsheet: "Tell me exactly how to build a pivot table that shows revenue by month, excluding refunded rows. Step by step, which fields go where." The pivot table does the adding.

4. For documents, extract to a table first, then calculate

This is where AI really earns its keep. Reading a messy PDF, a scanned receipt, a bank statement or a paystub is hard for code and easy for a language model. Doing arithmetic on what it read is the opposite. So split the job in two.

Step one, extraction only:

Read the attached statement. Extract every transaction into a table with
columns: Date, Description, Amount (negative for money out), Running balance.
Also give me the opening balance and closing balance printed on the statement.
Do not total, summarize or calculate anything. Just copy what's there.

Step two, calculate somewhere that can't guess: paste the table into a spreadsheet, or ask Claude to check it with code ("Using code, confirm opening balance plus all transactions equals the closing balance, and list any rows where the running balance doesn't follow").

For bank statements specifically, our free bank statement converter does both halves in your browser: it pulls the transactions into a table and then reconciles the math in code, flagging rows where opening balance plus transactions doesn't equal the closing balance. Nothing gets uploaded. If you're using this for household money, Claude for personal finance has more prompts for budgets and spending reviews.

5. Always check the totals

Whatever route you take, do one sanity check before you rely on a number:

  • Does it add up to a number you already know? The statement's closing balance, the invoice total, last month's revenue.
  • Is it the right size? If your monthly payroll is about $40,000 and the AI says $4,000 or $400,000, something slipped.
  • Recalculate one line by hand (or with your phone's calculator). If one is wrong, assume others are.
  • Ask it to show its work in a formula or code, never in prose. "Approximately $12,450" with no formula is a guess wearing a suit.

Case study: how my own tool was paying AI to do arithmetic

I learned this lesson with my own money.

I built a free tool that checks paystubs and bank statements. You upload a document, and it tells you whether the numbers hang together: does gross pay minus deductions equal net pay, do the year-to-date totals make sense, do the dates line up. My first version sent the whole document to a mid-priced AI model and asked it to read everything and check all the math and give a score.

It worked. It was also slow and expensive. Each request took around 26 seconds, and after roughly 400 scans I'd spent about $20. That's about 5 cents a scan, for a free tool.

When I dug in, the reason was obvious. The model was spending most of each request "thinking": quietly working through the arithmetic step by step before answering. That hidden reasoning is billed as output, and output is the expensive part. I was paying a language model to do subtraction, which is the one thing it's worst at and a computer does for free.

So I split the job the way this whole article describes:

  1. A cheap model only reads. It pulls the numbers off the document into a fixed structure: gross pay, each deduction, net pay, year-to-date figures, pay period dates. No math, no opinions.
  2. Plain code does everything else. It checks that gross minus deductions equals net, that year-to-date totals are consistent, that the dates make sense, and it calculates the score.

My estimate for the same 400 scans after the change is roughly a dollar or two, somewhere around 10 to 18 times cheaper. Those are estimates from my own usage, not a benchmark. The bigger win wasn't even the cost. The math became deterministic: the same document gives the same answer every time, and when a check fails I can see exactly which line didn't add up.

For builders: read with AI, calculate with code

If you're building anything with AI that touches numbers (a quoting tool, an invoice checker, a reporting dashboard), here's the same idea in plain language:

  • Use the AI for structured extraction. Ask it to fill in a fixed form: these fields, these types, nothing else. Reading is what language models are cheap and good at, and a smaller, cheaper model is often plenty.
  • Do the math in ordinary code. Totals, checks, percentages, scoring, comparisons. Code is free to run, instant, and gives the same answer every time.
  • Let code catch the AI's reading mistakes. If the extracted gross minus deductions doesn't equal the extracted net, either the document is wrong or the extraction is. Either way, you've caught it, instead of a model confidently "fixing" it.
  • Watch for hidden reasoning costs. Models that "think" before answering bill that thinking as output. If a task is mostly arithmetic, that's money spent on the wrong worker.
  • Tool use is the bridge. Most AI platforms let the model ask your code to run something (often called function calling or tool use) and get the result back. Claude's API also has a code execution tool that runs Python in a sandbox for exactly this kind of work.

The short version: the AI is the reader and the writer. Your code is the accountant.

Frequently asked questions

Is ChatGPT accurate?

It depends on the task, the model and whether it can search or run code. There's no single official accuracy number. In OpenAI's own tests, GPT-5 answered hard closed-book fact questions correctly only about half the time, but with browsing on in real ChatGPT use its share of incorrect claims dropped to single digits. For math, it's accurate when it calculates with code or writes a formula you run in a spreadsheet, and unreliable when it does long arithmetic in its head.

Is Claude good at math?

Claude is good at understanding math problems, choosing the right approach and writing formulas, SQL or code. Like every language model, it isn't reliable at long arithmetic in its head. Turn on code execution in Settings, then Capabilities, and ask it to calculate with code, and the arithmetic becomes as reliable as the code it runs.

Can ChatGPT do math?

Yes, with the right setup. It can explain concepts, set up equations and write spreadsheet formulas well. For actual calculations on real numbers, ask it to use its data analysis feature to run code, or ask for a formula and let Excel or Google Sheets do the arithmetic.

Why is AI bad at counting?

AI models read and write tokens, which are chunks of text, not individual letters or words. That means they don't keep a running count of words, characters or repeated items, and research shows counting repeated things is a separate weak spot. If an exact count matters, use a word counter or ask the AI to count with code.

What is the best way to get AI to do math?

Let the AI write the math and let something else run it. Ask for an Excel formula instead of an answer, turn on code execution and ask it to calculate with code, ask for a SQL query or pivot table for bigger data, and for documents extract the numbers into a table first and calculate second. Then check the total against a number you already know.

Learn to use AI the right way

The habit in this article (let AI read and write, let tools do the math) is one of the most useful things you can learn about working with AI. Our free Claude Cowork course shows you how to set Claude up for real work, with files, spreadsheets, Projects and connectors, step by step and with no technical background needed.

Keep going:

Clarence

Turn a good idea into a useful skill.

Practice what you’ve read with 12 interactive AI courses, from better prompts to real business workflows.

Explore the bundle — $39.99 →

← All guides


MIT 2026 © Nextra.