mygems

How to analyze a CSV file with AI, and what it sends (2026 guide)

ChatGPT, Claude and Gemini can all read a CSV, but they read all of it. Here is how each one works, where they get numbers wrong, and a way to ask without uploading.

By uos ·

Upload a CSV to ChatGPT, Claude or Gemini and ask it a question. That is the whole method, it works, and for most files it is the right answer. Two things are worth knowing before you do it with anything that matters: the whole file leaves your device, and the number you get back is only as good as whether the model ran code to get it.

The fast answer

  • Non-sensitive file, real analysis: upload it to ChatGPT, Claude or Gemini and ask. Then check the answer against one number you already know.
  • Customer, payroll or bank data: don't upload the rows. Use a tool that sends the AI only your column names, gets a query back, and runs it locally.
  • You want the exact number, every time: skip the chat and ask SQL. AI is good at writing the query; it is the query that is reliable.

How the chat assistants actually read a CSV

There are two very different things a chatbot can do with your file, and the interface doesn't always tell you which one happened.

It runs code. ChatGPT, Claude and Gemini can all write a short program (usually Python with pandas), execute it against the file in a sandbox, and report the result. When this happens, a sum is a real sum over every row. You'll usually see the code, or a "thinking" or "analysis" step you can expand.

It reads the text. The CSV is pasted into the conversation as text and the model answers from what it "sees". This is fine for "what are the columns" or "describe this data". It is not fine for "what's the total revenue", because a language model asked to add up 4,000 numbers in its head will produce a number, confidently, and it will be wrong.

The one rule: for any number you intend to use, ask the assistant to show the code it ran. If there is no code, there was no calculation.

Large files make the second case more likely. A file too big for the model's context gets truncated or sampled when read as text, and the answer is then about the part it saw.

The three big assistants, briefly

How to use itGood atWatch for
ChatGPTAttach the CSV and askCharts, pivots, cleaning, then handing back a new fileFile size caps on spreadsheets; check the code ran
ClaudeAttach the CSV and askExplaining what's in an unfamiliar file, careful reasoningSame: ask for the analysis to be run, not estimated
Gemini in Google SheetsOpen the CSV in Sheets, use the Gemini side panelData already in Sheets; formulas you can keepSheets' own 10 million cell limit applies first

All three change their limits often enough that any number printed here would be stale by next quarter. The pattern doesn't change: ask, then verify.

Prompts that work

Vague questions get vague answers. Name the columns and the operation:

  • "Using the amount and category columns, total amount per category, sorted highest first. Show the code."
  • "How many rows have an empty email? List the first ten ids."
  • "Plot monthly totals of amount by order_date as a line chart."
  • "Before answering anything, tell me how many rows and columns you loaded."

That last one is the most useful sentence in this guide. If the row count it reports isn't the row count of your file, nothing it says afterwards is about your file.

What leaves your device

Uploading a CSV to a chat assistant sends every cell to the provider's servers. Whether it is kept, and whether it is used for training, depends on your plan and your settings, and is a question for the provider's privacy page rather than this one.

For a public dataset, that doesn't matter. For a CRM export, a payroll file, a bank statement or anything with personal data in it, it is often not your decision to make: your employer's policy, or the law where you live, may already have made it.

Asking without uploading the rows

There is a second way to put AI on a CSV, and it is the one to use when the data is private: send the AI the shape of the file, not its contents.

  1. The AI gets your question and the column names, nothing else.
  2. It writes a query, usually SQL.
  3. The query runs on your machine, against your file.

The model never sees a value, so it can't leak one, and it can't do arithmetic badly in its head either, because the arithmetic is done by a query engine. You can do this by hand with any chatbot: paste only the header row, ask for a DuckDB query, and run it yourself. The SQL on a CSV guide shows how.

On a phone, that is exactly how Smart CSV Viewer's assistant works. You type the question; only the question and the column names go to the server; the filter it sends back runs on the phone, and you see the matching rows before anything is applied to the table.

The Ask about your data sheet, with suggested questions and a note that only column names are sent
The column names are all it sends
An answer card: Trips in Europe under 2000 dollars, 4 of 30 rows, with Rome, Barcelona, Prague and Amsterdam listed, and an Apply button
The answer is a filter you can inspect

Show SQL on the answer card shows the query it ran, which is the "show the code" rule from earlier, built in.

CSV File Viewer - Smart CSViPhone & iPad · Android

Ask about a CSV in plain words on iPhone or Android. Only your question and column names leave the phone; the filter runs locally, with the SQL one tap away.

What it does

What it is not: a report writer. It finds, filters and orders rows. For "summarise this file in three paragraphs" you want a chat assistant, and the upload that comes with it.

Checking any AI answer in thirty seconds

Whatever tool you use, before you paste an AI's number into a slide:

  1. Row count. Does it match the file? (wc -l on a desktop, or the count your viewer shows.)
  2. One known total. Pick a figure you can verify another way, such as last month's revenue from your dashboard, and ask for it. If that's wrong, the others are too.
  3. The filter. For "how many customers in Germany", look at the condition it used. country = 'Germany' misses DE, germany and Germany with a trailing space. AI writes the obvious query; your data is rarely obvious.

When AI is the wrong tool

  • Repeated reports. If you ask the same question every Monday, write the query once and save it. A chatbot gives a slightly different answer each time, by design.
  • Huge files. Past a few hundred megabytes, uploading is the slow part. A local engine like DuckDB will answer before the upload finishes. See how to open a 1GB CSV file.
  • The data is wrong. No assistant will tell you that half your dates are in MM/DD and half in DD/MM unless you ask. Look at the file first.

Questions

Can ChatGPT analyze a CSV file?
Yes. Attach the file and ask a question; ChatGPT can write and run Python against it to compute totals, pivots and charts. Ask it to show the code it ran, because an answer produced without code is an estimate, not a calculation.
Is it safe to upload a CSV to an AI chatbot?
It sends every cell to the provider. For public or non-sensitive data that is usually fine. For personal, financial or customer data, check your employer's policy and the provider's data settings first, or use a method that sends only the column names and runs the query locally.
Why does the AI give the wrong total for my CSV?
Usually because it read the file as text and estimated instead of running code, or because a large file was truncated before it read it. Ask how many rows it loaded, and ask it to compute the figure with code.
Can I use AI on a CSV without uploading my data?
Yes. Give the AI only your column names and ask it to write a SQL query, then run that query yourself with a local tool such as DuckDB. Some apps, including Smart CSV Viewer, do this automatically: the question and column names are sent, the rows are not.
What's the best AI for analyzing CSV files?
ChatGPT, Claude and Gemini all handle ordinary CSV analysis well when they run code. The difference that matters more is where your data goes and whether you verify the result, not which model you pick.

uos — Builds Smart CSV Viewer, whose AI assistant sends your column names and never your rows.