top of page

How to analyze a CSV over ChatGPT's 50MB limit with chunks and samples

2 hours ago
9 min read
Cover showing the title How to analyze a CSV over ChatGPT's 50MB limit with chunks and samples over a teal city skyline, Data Studios original cover

ChatGPT accepts files of up to 512 MB, yet a CSV or spreadsheet sent to its data analysis feature has a much lower ceiling. OpenAI's File Uploads FAQ, checked on November 17, 2026, states that for CSV files or spreadsheets "the file size cannot exceed approximately 50MB, depending on the size of each row." An export from a CRM, a web analytics tool or an order system passes that size quickly, and the upload then fails before any analysis starts.


The workable answer is to change what you upload. A large CSV can be reduced on your own machine to a summary table, split into parts that each stay under the limit, cut down to the columns the question needs, or replaced by a random sample for exploration. Each method keeps some answers exact and makes others approximate, and the difference decides whether the totals ChatGPT reports can go into a dashboard or a report.


The method also changes the arithmetic. When a file is analyzed in parts, sums and row counts can be added together across parts, while averages and medians cannot. The worked example below uses a 12-row orders table split into three parts to show the correct combined result and the wrong one that appears when averages are averaged.


··········


CHATGPT CSV SIZE LIMITS FOR DATA ANALYSIS.


OpenAI documents the relevant limits on two help pages, the File Uploads FAQ and the Data analysis with ChatGPT page. Data analysis works by writing and running Python: the help page says ChatGPT "uses pandas to analyze your data and Matplotlib to create both static and interactive charts." That detail is useful later, because it means the pandas code you run locally to check a result is the same kind of code ChatGPT runs on your data.


........


Limit

Value documented by OpenAI

Any file in a chat or GPT

512 MB per file

CSV or spreadsheet

About 50 MB, depending on row size

Text and document files

2M tokens per file (not spreadsheets)

Files per conversation (data analysis)

Up to 10

Storage per end user

10 GB

Code environment lifetime

Destroyed within 13 hours of inactivity


........


The 50 MB figure is approximate by OpenAI's own wording, so a file of 48 MB with very wide rows may still be refused. Leave a safety margin and aim for parts of roughly 40 to 45 MB. The FAQ also lists upload frequency caps that vary by plan and may be reduced at peak times. Those caps count when a file is split into several parts, and on a free account the FAQ lists 3 file uploads per day. A full rundown of plan caps is in our article on ChatGPT file upload limits.


The supported formats for data analysis listed by OpenAI are Excel (.xls and .xlsx), CSV, PDF and JSON. Compressed archives and columnar formats such as Parquet are not on that list, so converting a CSV into one of them is not a documented way around the limit.


··········


FOUR WAYS TO FIT A LARGE CSV INTO CHATGPT.


The right method depends on the question. A request for exact totals by region needs every row to be counted once. A request to describe the shape of the data, spot odd values or suggest a chart can work from a fraction of the rows.


........


Method

Exact results

Good for

Main risk

Aggregate locally, upload summary

Yes

Totals, counts, trends

Losing row-level detail

Split into parts under 50 MB

Yes, if combined correctly

Row-level checks, totals

Averaging averages

Keep only needed columns

Yes

Wide exports

Dropping a needed field

Random sample

No

Exploration, charts, cleaning rules

Missing rare values


........


Removing columns is the simplest first step, because many exports carry free-text fields, URLs and IDs that the analysis never uses. A file with 40 columns where the question needs 5 can fall well below the limit without losing a single row. If it is still too large, the choice is between local aggregation and splitting.


Local aggregation is the most reliable route for totals. A few lines of pandas read the file in pieces, add up sums and counts, and produce a summary of a few hundred rows that ChatGPT can chart, compare and explain. The code below reads 300,000 rows at a time, so even a file larger than your computer's memory can be processed.


import pandas as pd

totals = None
for part in pd.read_csv("orders_full.csv", chunksize=300_000,
                        usecols=["region", "amount_usd"]):
    g = part.groupby("region")["amount_usd"].agg(["sum", "count"])
    totals = g if totals is None else totals.add(g, fill_value=0)

totals["mean"] = totals["sum"] / totals["count"]
print(totals)

Splitting is the right choice when ChatGPT needs to see actual rows, for example to find duplicates, check formats or look up individual orders. Each part becomes a separate upload, and the results have to be combined with care.


··········


SIZING THE PARTS FOR A 168 MB ORDERS FILE.


Take an illustrative export of 1,200,000 orders that weighs 168,000,000 bytes. Dividing size by rows gives 140 bytes per row. With a target of 45,000,000 bytes per part, each part can hold at most 321,428 rows. Rounding down to 300,000 rows gives four parts of about 42,000,000 bytes each, under the documented ceiling with room for rows that are longer than average, and within the limit of 10 files per conversation.


The script below writes the parts. Each part keeps the header row, which ChatGPT needs to read the columns correctly. The data analysis help page recommends descriptive headers in the first row, one row per record and no empty rows or columns, so it is a good moment to fix those issues before uploading.


import pandas as pd

SOURCE = "orders_full.csv"
ROWS_PER_PART = 300_000

for i, part in enumerate(pd.read_csv(SOURCE, chunksize=ROWS_PER_PART), start=1):
    part.to_csv(f"orders_part_{i:02d}.csv", index=False)
    print(i, len(part))

Check the size of each output file before uploading. If a part is still above about 45 MB, lower ROWS_PER_PART and run the script again. If the data needs cleaning first, the steps in our guide to cleaning and deduplicating a CSV with ChatGPT apply to each part, with one caveat: duplicates that sit in two different parts will not be caught by checking each part on its own.


··········


WORKED EXAMPLE: COMBINING CHUNK RESULTS IN CHATGPT.


The illustrative table below stands in for a large orders file. It has 12 rows, split into part A (orders 1001 to 1004), part B (1005 to 1008) and part C (1009 to 1012).


........


order_id

region

amount_usd

part

1001

East

120.00

A

1002

West

80.00

A

1003

East

200.00

A

1004

South

60.00

A

1005

West

340.00

B

1006

West

90.00

B

1007

East

50.00

B

1008

South

110.00

B

1009

East

75.00

C

1010

South

95.00

C

1011

West

60.00

C

1012

East

410.00

C


........


For each part, ask ChatGPT for values that can be added together. A prompt that requests an average per part invites the error shown further down.


This file is part 1 of 3 of the same orders export. For each region,
return the sum of amount_usd and the number of rows as a table with
columns region, sum, count. Do not compute averages. Also report the
total row count of this file and any rows where amount_usd is empty.

The three parts return these partial results, computed in Python on the illustrative data:


........


Part

East sum / count

South sum / count

West sum / count

A

320 / 2

60 / 1

80 / 1

B

50 / 1

110 / 1

430 / 2

C

485 / 2

95 / 1

60 / 1


........


Then paste the three partial tables into the conversation, or into a new one, with a combining prompt:


Combine these partial results from three parts of one file. Add the
sums and the counts by region, then compute each region's average as
total sum divided by total count. Show the Python you used.

The correct combined result is below. The total across all regions is 1,690.00 USD over 12 orders, an average of 140.83 USD per order.


........


Region

Sum (USD)

Orders

Correct average (USD)

Average of part averages (USD)

East

855.00

5

171.00

150.83

South

265.00

3

88.33

88.33

West

570.00

4

142.50

118.33


........


The last column is the mistake to watch for. East has part averages of 160.00, 50.00 and 242.50, and their simple average is 150.83, while the true average is 171.00, because part B holds only one East order and the simple average gives it the same weight as parts with two. South happens to match because it has one order in every part. The same rule applies to medians: the East medians by part are 160.00, 50.00 and 242.50, yet the median of all five East orders is 120.00, and no arithmetic on the part medians recovers it. When a median, percentile or distinct count is needed across the whole file, compute it locally or ask ChatGPT for it on a summary that contains every value.


You can verify the combining step with this short script, which reproduces the table above:


import pandas as pd

parts = pd.DataFrame({
    "region": ["East", "South", "West", "East", "South", "West", "East", "South", "West"],
    "sum":    [320, 60, 80, 50, 110, 430, 485, 95, 60],
    "count":  [2, 1, 1, 1, 1, 2, 2, 1, 1],
})
combined = parts.groupby("region")[["sum", "count"]].sum()
combined["mean"] = (combined["sum"] / combined["count"]).round(2)
print(combined)

··········


SAMPLING A LARGE CSV FOR CHATGPT EXPLORATION.


A random sample is the fastest way to start a conversation about a large dataset. It is suitable for describing columns, finding formatting problems, drafting cleaning rules, choosing chart types and writing pandas code that you will later run on the full file. It is unsuitable for totals, counts of rare events and anything that will be reported as a figure, since every number computed on a sample is an estimate.


import pandas as pd

df = pd.read_csv("orders_full.csv")
sample = df.sample(n=200_000, random_state=42)
sample.to_csv("orders_sample.csv", index=False)
print(len(df), len(sample))

Fixing random_state makes the sample repeatable, so a colleague can rebuild the same file. Avoid taking the first rows of the export as a shortcut, because exports are often sorted by date or ID and the first rows describe only one period. When the sample is uploaded, say so in the prompt, for example "this is a random sample of 200,000 of 1,200,000 rows", so that ChatGPT does not present sample totals as totals for the business. For more background on how ChatGPT reads and parses CSV files, see our explainer on whether ChatGPT can analyze CSV files.


··········


CHECKING CHATGPT'S ANSWERS ON CHUNKED DATA.


Every part should be checked for completeness before its numbers are used. Ask ChatGPT to report the row count of each file and compare it with the count your split script printed; the parts must add up to the row count of the original export. A mismatch usually points to quoted fields containing line breaks or to rows that failed to parse.


Ask for the Python code behind each result and read the grouping and filtering steps. Common errors in this task are averaging averages, counting the header row as data, treating empty amounts as zero instead of missing, and applying a filter in one part but not in the others. Keep the prompt identical across parts so that every part is processed the same way.


Keep the final combination under human control. The partial tables are small enough to recombine in a few seconds with the script above, and any figure that goes into a dashboard, a board deck or a financial report should be reconciled with a total from the source system. If the same large file has to be analyzed every week, a warehouse such as BigQuery is a better long-term home; our reference on Connected Sheets limits for BigQuery covers how large tables can be queried from a spreadsheet.


··········


PRIVACY AND RETENTION OF CSV FILES UPLOADED TO CHATGPT.


Splitting a file does not change how its contents are handled, and every part is an upload of real data. OpenAI's FAQ says files uploaded to ChatGPT are kept in the account for the retention period of the chat, and that files in a deleted chat are deleted from OpenAI's systems within 30 days, with exceptions described on the page. It also says files uploaded to data analysis are deleted "within a duration that varies based on your plan." The data analysis page states that the code environment cannot make outbound network requests directly and is destroyed within 13 hours of inactivity in the conversation.


Local aggregation has a privacy advantage: the summary table sent to ChatGPT contains no customer names, emails or order-level detail. When row-level data has to be uploaded, drop personal columns that the question does not need and check your organization's policy on which ChatGPT plan may receive company data.


··········


LARGE CSV FILES IN CHATGPT: WHAT THE LIMITS ALLOW.


OpenAI documents a hard limit of 512 MB for any file and an approximate limit of 50 MB for CSV files and spreadsheets, with the exact threshold depending on row size. Data analysis allows up to 10 files per conversation, which caps how many parts a single chat can take, and upload frequency limits depend on the plan.


Within those limits, exact totals are possible when the file is aggregated locally or split into parts whose sums and counts are added together. Averages must be rebuilt from combined sums and counts, and medians, percentiles and distinct counts need either the full data or a local calculation. Random samples serve exploration and code drafting, and their figures stay estimates. In the worked example, averaging part averages understated East by 20.17 USD per order and West by 24.17 USD, a gap that only a combined sum and count catches.


··········


FOLLOW US FOR MORE.


·····


DATA STUDIOS


·····


datastudios.org


bottom of page