# Spreadsheet Converter: Excel/CSV to JSON, JSON to CSV/Excel (`quicktools/spreadsheet-converter`) Actor

Convert Excel (XLSX, XLS), CSV and TSV to JSON or JSON Lines with all sheets, typed values and header detection, or turn JSON/JSONL back into CSV, TSV or Excel. Upload files or give URLs. Pay per file.

- **URL**: https://apify.com/quicktools/spreadsheet-converter.md
- **Developed by:** [T O](https://apify.com/quicktools) (community)
- **Categories:** Developer tools, Automation, Integrations
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$8.00 / 1,000 files

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Spreadsheet Converter — Excel & CSV to JSON, JSON to CSV / Excel

Convert **Excel (XLSX, XLSM, XLS), CSV and TSV** to **JSON or JSON Lines** — **all sheets**, **typed values** (numbers, booleans, ISO dates, nulls) and **automatic header detection** — or go the other way and turn **JSON / JSONL into CSV, TSV or Excel**. Upload files or give URLs; get download links for the converted files. Built for **APIs, no-code automations (Make, Zapier, n8n), data pipelines and AI agents** that need clean JSON from spreadsheets.

### Conversions

| From | To (default in bold) |
|---|---|
| XLSX / XLSM / XLS | **JSON**, JSON Lines, CSV, TSV, XLSX |
| CSV / TSV (any delimiter, UTF-8 / UTF-16 / Windows-1252) | **JSON**, JSON Lines, XLSX, CSV, TSV |
| JSON array / object of arrays / JSON Lines | **CSV**, TSV, XLSX, JSON Lines |

### Smart defaults

- **All sheets** (or pick by name); empty leading rows and trailing empty columns are trimmed.
- **Header detection**: first non-empty row is used as column names when it looks like a header; otherwise `column_1`, `column_2`, … Duplicate names get suffixes.
- **Typed values**: `42` → number, `true` → boolean, Excel dates → `2026-11-01T09:30:00`, empty → `null`. **Leading zeros are preserved** (`06601` stays text — ZIP codes and IDs survive).
- **Nested JSON → CSV/Excel**: objects are flattened to dotted columns (`address.city`), arrays written as JSON text; the column set is the union of all keys.
- CSV output has a UTF-8 BOM so Excel opens accents correctly; choose comma, semicolon or pipe.

### Input example

```json
{
  "fileUrls": ["https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv"],
  "outputFormat": "auto",
  "headerRow": "auto",
  "typedValues": true
}
```

### Output example (one dataset row per file)

```json
{
  "fileName": "orders.xlsx",
  "status": "ok",
  "inputFormat": "xlsx",
  "outputFormat": "json",
  "sheetCount": 2,
  "totalRows": 9,
  "outputUrl": "https://api.apify.com/v2/key-value-stores/<storeId>/records/59b2f2e164-orders.json",
  "sheets": [
    { "name": "Orders", "rows": 6, "columns": 7, "headerDetected": true,
      "headers": ["Order ID", "Date", "Customer", "Qty", "Price", "Paid", "ZIP"],
      "preview": [{ "Order ID": 1001, "Date": "2026-11-01T09:30:00", "Customer": "Customer 1", "Qty": 2, "Price": 9.99, "Paid": false, "ZIP": "06601" }] }
  ]
}
```

Single-sheet JSON output is a plain array of row objects. Multi-sheet output is `{"sheets": [{"name", "headers", "rows"}]}` — and that shape converts straight back to a multi-sheet XLSX.

### Pricing (pay per event)

| Event | Price |
|---|---|
| File converted (all sheets) | **$0.008** |

100 files = **$0.80**. Failed downloads, unsupported or corrupt files and oversize files are **free**.

### Limits & notes

- Up to 25 MB per file by default (max 50 MB) and 300,000 rows per sheet (max 1,000,000).
- Excel formulas: the value last calculated by Excel is used. Files generated by scripts that never ran in Excel may have empty formula cells.
- Decimal commas in CSV (`3,50`) are kept as text.
- Legacy `.xls` is read; writing is XLSX only.

### FAQ

**Does it use an external API?** No. Conversion runs inside the Actor with open-source libraries (openpyxl, xlrd, Python csv).

**Can I call it from Make / Zapier / n8n?** Yes — run it synchronously via the Apify API and read `outputUrl`, or read the dataset items directly.

### About

Built with AI assistance by QuickTools and tested on real sample files before release. File didn't convert? Open an issue on the Issues tab.

# Actor input Schema

## `files` (type: `array`):

Upload files or paste public URLs. Spreadsheets: XLSX, XLSM, XLS, CSV, TSV. JSON: JSON array/object or JSON Lines (.jsonl/.ndjson).

## `fileUrls` (type: `array`):

Public file URLs, one per line. Combined with the field above; up to 1,000 files per run.

## `outputFormat` (type: `string`):

Auto: spreadsheets become JSON, JSON becomes CSV. CSV/TSV output writes one file per sheet.

## `sheets` (type: `array`):

Sheet names to convert. Leave empty for all sheets.

## `headerRow` (type: `string`):

Auto detects whether the first non-empty row holds column names. None generates column_1, column_2...

## `typedValues` (type: `boolean`):

Numbers, booleans, dates and empty cells become JSON numbers, true/false, ISO dates and null. Values with leading zeros (ZIP codes, IDs) stay text. Off = everything as text.

## `flattenNested` (type: `boolean`):

Nested objects become dotted columns (address.city). Arrays are written as JSON text.

## `csvDelimiter` (type: `string`):

Auto-detected by default.

## `outputCsvDelimiter` (type: `string`):

Semicolon is common in European Excel.

## `previewRows` (type: `integer`):

First rows of each sheet shown in the results table. The full data is always in the output file.

## `maxRowsPerSheet` (type: `integer`):

Files with bigger sheets fail (not billed) instead of running out of memory.

## `maxFileSizeMb` (type: `integer`):

Larger files are skipped and not billed.

## `maxConcurrency` (type: `integer`):

Files converted in parallel.

## Actor input object example

```json
{
  "fileUrls": [
    "https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv"
  ],
  "outputFormat": "auto",
  "headerRow": "auto",
  "typedValues": true,
  "flattenNested": true,
  "csvDelimiter": "auto",
  "outputCsvDelimiter": "comma",
  "previewRows": 5,
  "maxRowsPerSheet": 300000,
  "maxFileSizeMb": 25,
  "maxConcurrency": 2
}
```

# Actor output Schema

## `overview` (type: `string`):

One item per input file: status, formats, sheet and row counts, and download URLs.

## `files` (type: `string`):

All converted files in the default key-value store.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fileUrls": [
        "https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("quicktools/spreadsheet-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "fileUrls": ["https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv"] }

# Run the Actor and wait for it to finish
run = client.actor("quicktools/spreadsheet-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fileUrls": [
    "https://people.sc.fsu.edu/~jburkardt/data/csv/addresses.csv"
  ]
}' |
apify call quicktools/spreadsheet-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,quicktools/spreadsheet-converter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/SXLp6I9LD5ar2erL0/builds/JLIlu79maDVQb9S1p/openapi.json
