Navigated to blog › best-format-data-for-ai
Back to Blog
ai-data-prep

Best Format for ChatGPT and Claude: CSV, JSON, JSONL, or Excel? (2026)

May 27, 2026
11
By SplitForge Team

For interactive analysis in ChatGPT or Claude, use CSV — the most token-dense format for flat tabular data. Use JSONL for fine-tuning, batch API calls, and RAG pipeline ingestion. Use plain text or Markdown for prose documents. XLSX works natively in ChatGPT but adds friction in Claude. Picking the wrong format inflates token usage, blocks the analysis tool, or both.

TL;DR: The format decision is driven by workflow — CSV for interactive chat-based analysis, JSONL for AI pipelines, plain text for prose documents. JSON adds the column name as a key on every row; for large flat tables this makes the same data substantially more token-expensive than the equivalent CSV. Format Converter handles CSV, JSON, JSONL, and Excel conversions entirely in your browser — no file leaves your device before you decide where it goes.

A 50,000-row CRM export sent to Claude as JSON returned a context limit warning before analysis began. The same dataset as CSV fit within Claude's 500MB file limit and processed without issue. The difference was not the data — it was the key-per-row overhead that JSON adds to every column in every row of a flat table.

Table of Contents


Format Comparison Matrix

The right format depends on two things: your task (interactive chat vs. pipeline ingestion) and your target platform (ChatGPT, Claude web, or Claude API). CSV is the best default for interactive spreadsheet analysis — the most token-efficient format for flat tabular data because the header row is written once. JSONL is the industry standard for fine-tuning, batch processing, and RAG ingestion. XLSX works natively in ChatGPT but requires the Analysis tool in Claude. Plain text and Markdown are correct for prose documents, not for tables.

FormatChatGPT Data AnalysisClaude webClaude APIToken economyBest use case
CSVNative (~50MB cap)Native (~500MB cap)Text block or Files APILowest for tabular data — header onceInteractive analysis, large row counts
JSONText or file blockText or file blockText blockHigher than CSV — key name on every rowSchema-aware queries, nested structures
JSONLText or file blockText or file blockText block or Files APIModerate — keys per row, but streamableFine-tuning, Batch API, RAG ingestion
XLSXNative (~50MB cap)Requires code execution and file creationNot accepted as documentBinary — not tokenized directlyChatGPT-only; convert to CSV for Claude
Markdown / plain textText blockDocument blockDocument blockLowest for prose; poor for tabular dataReports, summaries, structured prose

Sources: OpenAI File Uploads FAQ · Claude: Upload Files to Claude · OpenAI Fine-tuning Guide


Why Format Matters for AI

Format is not just a container — it changes how much of your data the AI can see and how much reasoning budget remains after the file is ingested. Choosing CSV over JSON for the same 50,000-row dataset can mean the difference between a single analysis pass that fits the context window and a truncated run that misses half your records.

The first mechanism is token economy: CSV encodes column names once in the header, then repeats only values. JSON encodes the column name as a key alongside the value on every row — for a flat table with 10 columns and 10,000 rows, those key names appear 10,000 times rather than once. The exact token difference depends on key length, value types, and encoding, but the direction is consistent: JSON is more token-expensive than CSV for flat tabular data.

The second is platform behavior: each platform parses formats differently, and format determines whether your data is readable at all — not just how much context it consumes. ChatGPT's Data Analysis tool loads CSV and XLSX natively into an in-memory dataframe, a binary operation that does not consume your context window the way raw text does. Claude reads CSV as a text block; the Claude API does not accept XLSX as a document type.


CSV: the Default for Interactive Analysis

CSV (RFC 4180) is the right default for uploading tabular data to ChatGPT or Claude for interactive analysis. It is universally supported, has no formatting overhead, and gives you the most rows per token budget of any tabular format. If your goal is "load this dataset into the AI and ask questions about it," start with CSV.

When CSV is the right call:

  • Interactive analysis in ChatGPT or Claude web — the data fits in a single upload and you are asking ad hoc questions
  • Large row counts — CSV's header-once structure means more rows fit before the context window fills
  • Downstream pipeline input — CSV is a universal import format for every downstream tool

What to check before uploading:

  • File size under ~50MB for ChatGPT and ~500MB for Claude web — if it exceeds these, split by rows first (How to Split a Large CSV for ChatGPT Without Uploading It)
  • Encoding is UTF-8 — Windows-default ANSI encoding breaks Claude's parser on non-ASCII characters
  • No mid-row line breaks in free-text fields — these appear as extra rows to the parser

For a full breakdown of ChatGPT's row capacity and token math, see How Many Rows Can ChatGPT Handle?.


JSON: Schema-Aware Queries and Nested Data

JSON (ECMA-404) is the right format when your data is nested, when the AI needs to reason about schema rather than just values, or when you are passing a small dataset where the key-per-row overhead is acceptable. For large flat tables, it is usually the wrong choice.

When JSON earns its overhead:

  • Nested structures — a customer record with an array of orders embedded inside it cannot be naturally represented in CSV; JSON preserves the hierarchy
  • Schema-aware queries — asking the AI to describe or validate the data model is easier when the keys are self-describing per record
  • Small datasets where token budget is not a constraint — a 200-row configuration file or a small API response

The cost to keep in mind:

For flat tabular data, JSON repeats the column name as a key on every row — a table with columns date, vendor, amount, and category encodes those four key strings 10,000 times across 10,000 rows. The token overhead is not a fixed number (it depends on key length, value types, and whitespace) but it is always higher than the equivalent CSV. For large datasets, this is the primary reason JSON can hit context limits before CSV does.


JSONL: the Standard for AI Pipelines

JSONL (JSON Lines) is the standard input format for OpenAI's fine-tuning API, the Batch API, and most RAG ingestion pipelines — each line is a self-contained JSON object, making it ideal for streaming and systems that process records one at a time. For the fine-tuning schema, the required messages-array format, and a worked conversion example, see Convert Excel to JSON for AI APIs and LLM Pipelines.

When JSONL is the right call:

  • Fine-tuning — OpenAI's fine-tuning API requires JSONL with a specific messages-array schema
  • Batch API — OpenAI's Batch API accepts JSONL for asynchronous processing of many requests at once
  • RAG ingestion — LangChain document loaders, LlamaIndex, and most vector database connectors accept JSONL as a first-class input format

For the Excel → JSONL workflow, including how to export an .xlsx sheet directly to JSONL, see Excel File Too Big for AI? Reduce It in Your Browser First.


XLSX: ChatGPT Native, Claude Awkward

XLSX (ECMA-376) is the only format here that uploads to ChatGPT without pre-processing — the Data Analysis tool loads it natively alongside CSV, with the same ~50MB effective cap. For Claude, XLSX requires code execution and file creation to be explicitly enabled in account settings; without it, Claude cannot parse the binary format.

ChatGPT: XLSX uploads work out of the box. The practical reason to convert to CSV anyway is file size — Excel's XML overhead (styles, shared strings, theme files) means an XLSX file is often 5–10x larger than the equivalent CSV for the same data. If your XLSX is near the 50MB cap, exporting to CSV almost always resolves it.

Claude web: Upload requires code execution and file creation to be enabled. If you are unsure whether it is active, export to CSV — Claude reads CSV as a text document without any special tooling.

Claude API: XLSX is not a supported document block type. Convert to CSV (or plain text) before passing data through the API.

For a full breakdown of what causes Excel bloat and how to strip it before upload, see Excel File Too Big for AI? Reduce It in Your Browser First.


Markdown and Plain Text: for Documents, Not Tables

Markdown and plain text are the correct formats for prose content — reports, summaries, structured analysis narratives, documentation. They are not suited for tabular data: Markdown tables are token-expensive and error-prone to generate at scale; plain text with tab or space delimiters is fragile and often misread.

If your analysis involves a mix of data and narrative, keep the data as CSV and the narrative as a separate plain-text prompt. Mixing formats in a single file rarely improves how the AI processes either component.


How to Pick the Right Format

The format decision has four inputs. Work through them in order and the right format becomes unambiguous.

  1. What is your task?

    • Interactive chat analysis → CSV
    • Fine-tuning a model → JSONL (OpenAI fine-tuning schema)
    • Batch API or RAG pipeline → JSONL
    • Document summary or Q&A → Markdown or plain text
    • Nested data or schema validation → JSON
  2. Which platform are you targeting?

    • ChatGPT Data Analysis → CSV or XLSX (XLSX if under 50MB and you prefer the Excel workflow)
    • Claude web → CSV (XLSX requires Analysis tool; default to CSV to avoid dependency)
    • Claude API → CSV as a text block, or the Files API for structured data
  3. What is the shape of your data?

    • Flat rows and columns → CSV
    • Nested records (orders with line items, users with addresses) → JSON or JSONL
    • One logical object per line for a pipeline → JSONL
    • Prose with light structure → Markdown
  4. Do you need to convert? If your source file is XLSX or JSON and your target format is CSV or JSONL, convert before uploading. Format Converter handles all four conversions locally — the source file is processed on your device and only the output goes anywhere.

Converting locally also removes an intermediate data exposure — all three major AI platforms (ChatGPT, Claude, and Gemini) train on consumer conversations by default, so every upload reaches a system that may retain and train on your data; a converter adds a second exposure before the AI tool ever sees the file. For files containing customer records, financial data, or personally identifiable information, convert in your browser so the raw file never leaves your environment. For removing sensitive columns before any conversion, see How to Remove PII From a CSV Before Using AI.

If you are choosing a format for general business data workflows — not AI ingestion — the decision criteria are different. For sharing, storage, import compatibility, and tool interoperability outside the AI context, see CSV vs JSON vs Excel: Format Comparison for Business Data.


Additional Resources

How this guide was built: Format behavior verified against OpenAI and Anthropic documentation, May 2026. Token-economy observations from direct testing with Format Converter, ChatGPT Plus, and Claude web and API. JSONL schema requirements from the OpenAI fine-tuning guide. Platform caps from the OpenAI File Uploads FAQ and Claude support documentation.


FAQ

CSV is the best default for uploading data to ChatGPT for analysis — natively supported by the Data Analysis tool, with no formatting overhead and the lowest token cost for flat tabular data. XLSX also works natively; the practical reason to convert to CSV is file size (Excel overhead), not platform compatibility. For fine-tuning or Batch API use cases, use JSONL.

CSV is better than JSON for most ChatGPT analysis tasks. JSON encodes the column name as a key on every row — for a flat table this is a significant token overhead compared to CSV, which writes the header once and repeats only values. JSON is worth the overhead when your data is nested (records with sub-records) or when the dataset is small enough that token budget is not a constraint.

JSONL (JSON Lines) is a format where each line is a valid, self-contained JSON object — the standard input for OpenAI's fine-tuning API, the Batch API, and most RAG ingestion pipelines (LangChain, LlamaIndex, vector databases). If you are building an AI pipeline rather than doing interactive chat analysis, JSONL is the required format. For interactive analysis, CSV is simpler and more efficient.

XLSX works natively in ChatGPT but adds friction in Claude — Claude web requires code execution and file creation to be enabled, and the Claude API does not accept XLSX at all. The main practical issue is file size: Excel's formatting metadata inflates the file well beyond the raw data, and the ~50MB cap applies to XLSX and CSV equally. Exporting to CSV first resolves both the size issue and the Claude compatibility dependency.

Claude web accepts XLSX only if code execution and file creation is enabled in account settings; without it, Claude cannot parse the binary format. The Claude API does not accept XLSX as a document block — convert to CSV and pass it as a text block, or use the Files API. For most Claude workflows, exporting to CSV before upload removes the dependency.

CSV stores column names once in the header, then repeats only values; JSON stores the column name as a key alongside its value on every row. For a dataset with 10 column names and 10,000 rows, JSON encodes those key strings 10,000 times — CSV encodes them once. The exact difference depends on key length, value types, and whitespace, so treat any specific figure as an estimate — but the direction is consistent: JSON is always more token-expensive than CSV for flat tabular data.


Convert to the Right Format Before Uploading

Use CSV for interactive analysis — header-once structure keeps token costs low across large row counts Use JSONL for fine-tuning, batch API, and RAG pipelines — the industry-standard input format, column names embedded per record Convert XLSX to CSV before Claude uploads — removes the Analysis tool dependency and almost always reduces file size Convert locally so your raw file stays on-device — no intermediate server sees the data before it reaches the AI tool

Convert your data to the right format →

Continue Reading

More guides to help you work smarter with your data

csv-operations

Extract Phone Numbers from CSV Without the Junk (2026 Guide)

You exported 40,000 contacts, but the extractor grabbed order IDs, dates, and half a credit card as phone numbers. Here's how to pull only the real ones.

Read More
ai-data-prep

AI-Ready Data Checklist: 10 Things to Verify Before Upload (2026)

Before uploading to ChatGPT, Claude, or a fine-tuning API, run through this 10-point checklist. UTF-8 encoding, clean headers, PII removed, size within limits.

Read More
ai-data-prep

Convert Excel to JSON for AI APIs and LLM Pipelines (2026)

AI APIs and LLM pipelines expect JSON, not spreadsheets. Fine-tuning needs JSONL; direct prompts take arrays. Convert locally — no upload, no conversion server.

Read More