Excel to JSON Converter: XLSX, XLS & CSV to JSON API avatar

Excel to JSON Converter: XLSX, XLS & CSV to JSON API

Pricing

from $3.20 / 1,000 files

Go to Apify Store
Excel to JSON Converter: XLSX, XLS & CSV to JSON API

Excel to JSON Converter: XLSX, XLS & CSV to JSON API

Excel to JSON converter API: XLSX to JSON, XLS to JSON, CSV to JSON and ODS to JSON from file URLs, uploaded files or pasted text. Detects headers, types, delimiter and encoding, reads every sheet, and returns one JSON row per source row with file, sheet and row details.

Pricing

from $3.20 / 1,000 files

Rating

0.0

(0)

Developer

Data Done Right

Data Done Right

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Categories

Share

This Excel to JSON converter turns spreadsheets into clean JSON rows. Give it links to .xlsx, .xlsm, .xls, .ods, .csv or .tsv files, files you stored in a key-value store, or pasted CSV text. It finds the header row, converts numbers, booleans and dates, reads every sheet, and returns one dataset row per source row, with the file name, sheet name and row number on each row so you can trace it back. It works as an Excel to JSON API for apps, automations and AI agents, and the same run also does CSV to JSON and XLSX to JSON.

Excel to JSON

Paste file URLs (or upload files to a key-value store) and run. For every sheet the Actor:

  • Finds the header. Auto mode skips blank rows and title rows above the table. Or set the header row number, or turn the header off to get column_1, column_2, ...
  • Keeps real types. Excel numbers, booleans and dates stay numbers, booleans and dates. Floating-point noise from Excel is cleaned (0.1+0.2 reads as 0.3).
  • Handles messy headers. Blank headers become column_N, repeated names become name, name_2, name_3, and rows wider than the header keep their extra cells.
  • Reads every sheet by default, or only the sheets you name or number.
  • Nests dotted headers (address.city, address.zip) into objects when you turn on Nest dotted column names.
  • Skips what you do not need: blank rows, trailing empty rows and whitespace (all adjustable).

CSV to JSON

CSV and TSV need no setup:

  • Delimiter detection: comma, semicolon, tab or pipe, chosen from the first lines. Files with decimal commas (1,5;2,5) are read correctly.
  • Encoding detection: UTF-8 (with or without a byte order mark), UTF-16, Windows-1252 and Latin-1.
  • Type detection: 42 becomes a number, true/false become booleans, ISO dates stay ISO. Ambiguous values stay text: 007, +15551234567, 1e5 and 20-digit IDs are not turned into numbers.
  • Quoted fields with embedded delimiters, quotes and line breaks are parsed properly.

XLSX to JSON

  • .xlsx and .xlsm files are streamed row by row, so large workbooks do not need much memory.
  • Legacy .xls files and OpenDocument .ods files are supported too. .xls files are loaded into memory whole, so keep them well under the 50 MB default.
  • Formulas return the value Excel last saved (cached). Nothing is calculated here. A file written by a library that never calculated its formulas has empty cells where the formulas are; open and save it in Excel first.
  • Merged cells are not interpreted. In a merged range only the top-left cell has a value; the other cells are empty.
  • Charts, pictures, comments, filters and cell colors are ignored.
  • Macros are never executed or read. .xlsm files are read for their cell values only.
  • Password-protected workbooks and binary .xlsb files are not supported, and the error says so.

Excel to JSON API

Call the Actor from the Apify API, Python, JavaScript, Make, Zapier or n8n. Example with the Apify Python client:

from apify_client import ApifyClient
client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("data-done-right/excel-to-json-converter").call(run_input={
"fileUrls": ["https://example.com/reports/sales-2024.xlsx"],
"sheets": ["Sales"],
"headerRow": "auto",
"jsonFile": True,
})
rows = client.dataset(run["defaultDatasetId"]).list_items().items
summary = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("SUMMARY")["value"]

Upload a file first with client.key_value_store(id).set_record("report.xlsx", data, content_type="application/octet-stream") and pass {"storeKeys": ["report.xlsx"], "storeId": id} to convert files that are not on a public URL. Google Sheets links shared with "anyone with the link" are converted from their Excel export.

Input example

{
"fileUrls": ["https://example.com/reports/sales-2024.xlsx", "https://example.com/data/customers.csv"],
"inlineCsv": "name,plan,seats\nAda,pro,5\nGrace,team,12",
"sheets": ["Sales", "3"],
"headerRow": "auto",
"inferTypes": true,
"dateFormat": "iso",
"outputShape": "objects",
"flatten": false,
"maxRows": 100000,
"jsonFile": false
}

Main options: File URLs, Files in a key-value store, Paste CSV / TSV text, Sheets to convert, Header row, Skip empty rows, Trim whitespace, Detect numbers, booleans and dates, Date format (ISO, plain text, Unix milliseconds or Excel serial), Output shape, Max rows per sheet, CSV delimiter, CSV text encoding, Nest dotted column names, Rename duplicate column names, Add _file, _sheet and _row, Also save a JSON file and Max file size (MB) (default 50).

Output

One dataset item per source row:

{
"_file": "inline.csv", "_sheet": "csv", "_row": 2,
"name": "Ada Lovelace", "email": "ada@example.com", "signup_date": "2024-01-15",
"plan": "pro", "seats": 5, "active": true
}
  • _file, _sheet and _row (the row number in the source sheet) can be switched off.
  • Output shape "One array per row" gives values: [...] instead of named keys. "One object per sheet" gives one item per sheet with columns, rowCount and rows (about 9 MB per item at most, so use rows for big sheets).
  • A SUMMARY record in the key-value store lists, per file: format, size, encoding and delimiter (CSV), every sheet with its header row, column names and row counts, warnings (duplicate headers, rows cut at Max rows per sheet, unknown sheet names) and any error.
  • With Also save a JSON file, each file is also saved as <name>.json ({"file": ..., "sheets": [{"name", "columns", "rows"}]}) in the key-value store, with a public link in SUMMARY. It is included in the price. Files over 25 MB are served as text/plain.

Use it in Claude, ChatGPT and Cursor

Connect Apify's MCP server (mcp.apify.com) and your AI assistant can read spreadsheets for you. For example: "convert this Excel file to JSON, only the Orders sheet, and tell me which columns have empty values". The main inputs are fileUrls (or inlineCsv), sheets and headerRow.

Use cases

  • Spreadsheet to API data: turn a partner's Excel export into JSON your app can ingest.
  • Automations: feed Make, Zapier or n8n flows with rows from a CSV or XLSX attachment.
  • AI agents: give an agent clean rows and types instead of raw spreadsheet bytes.
  • Data migration: convert a folder of legacy .xls files in one run.
  • Quick checks: paste CSV text and see how it parses (delimiter, encoding, types).

How much does it cost

Pay per event: $0.004 per file converted (file) plus $0.00006 per row delivered (row, $0.06 per 1,000 rows). A 5-row CSV costs about $0.0043, a 1,000-row sheet about $0.064, and 100,000 rows about $6. A file that fails costs nothing: downloads that are blocked or too large, damaged or unsupported files, and files with no data rows are not charged, and the other files in the run still convert. Rows are charged once, as they are delivered; the JSON file option and the SUMMARY record are free. Paid Apify plans get 10% (Silver) to 20% (Gold and up) off. If you set a maximum spend per run, the Actor stops cleanly when it is reached and keeps the rows already delivered. Max rows per sheet and Max file size (MB) cap what a run can cost.

Safe by design

  • Links to localhost, internal names and private networks (including cloud-metadata addresses) are blocked, also after DNS lookup and on every redirect.
  • Files are limited to 50 MB by default (up to 500 MB). Spreadsheet archives that expand to more than 1 GB, have an extreme compression ratio or hold an oversized text table are rejected before they are read.
  • Formulas are never evaluated and macros are never run.

FAQ

How do I convert an Excel file to JSON?

Paste the link to the .xlsx file in File URLs and run the Actor. Each row of every sheet becomes one dataset item. Download the result as JSON, CSV or Excel, read it through the API, or turn on Also save a JSON file to get one .json file per input file.

Does it keep numbers and dates as numbers and dates?

Yes. Excel cells keep their types. Dates become ISO text (2024-01-15, or 2024-01-15T10:30:00 with a time) unless you pick plain text, Unix milliseconds or Excel serial numbers. For CSV, numbers, booleans and ISO dates are detected when it is unambiguous, and you can turn that off to get every value as text.

Why are my formula cells empty?

The Actor reads the value Excel saved with the file. If the file was produced by a script that never calculated its formulas, there is no saved value. Open the file in Excel, save it and convert again. Formulas are never evaluated here.

What do error cells like #N/A look like?

They come through as that text ("#N/A", "#DIV/0!"), because the Actor reads what Excel saved.

What about merged cells?

They are not interpreted. Only the top-left cell of a merged range has a value, so a merged header leaves blank headers (named column_N) next to it. Set Header row to the row that has the real column names.

Can it convert .xls, .ods, .xlsm and Google Sheets?

Yes to all four. .xlsb and password-protected workbooks are not supported. A Google Sheet must be shared with "anyone with the link".

How are CSV files with semicolons, tabs or accents handled?

The delimiter and the encoding are detected automatically. If a file is still read wrongly, set CSV delimiter or CSV text encoding.

What happens if one file fails?

It is reported in SUMMARY with the reason, it is not charged, and the other files still convert. The run only fails when no file could be converted.

Is there a size limit?

50 MB per file by default (up to 500 MB), 100,000 rows per sheet by default (up to 5,000,000), and about 9 MB per dataset item.

  • Merge Datasets & Dedupe: Combine, Filter, Export CSV & Excel: combine the converted rows with other data and remove duplicates.
  • Google Sheets Import & Export: Apify Data, No Login: send results to a Google Sheet.
  • HTTP Request Runner: Bulk API Calls, Retries, Proxies: post the converted rows to your own API.