CSV to JSON Converter with Schema Inference & Validation
Pricing
from $2.00 / 1,000 converted files
CSV to JSON Converter with Schema Inference & Validation
Convert CSV files to clean, typed JSON. Auto-detects delimiter, infers a JSON Schema, and validates rows against your own schema. Ideal for APIs, data pipelines and AI agents.
Pricing
from $2.00 / 1,000 converted files
Rating
0.0
(0)
Developer
Simon Fletcher
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
3 days ago
Last modified
Categories
Share
What does the CSV to JSON Converter do?
CSV to JSON Converter turns messy CSV files into clean, typed JSON you can drop straight into an API, a database, or an AI agent. It auto-detects the delimiter (comma, semicolon, tab or pipe), infers value types (integer, number, boolean, null), builds a JSON Schema describing your data, and can validate every row against a schema you provide. Give it a URL, an uploaded file, or raw CSV text — it gives back structured records, not a wall of strings.
Running on Apify means you get an HTTP API, scheduling, integrations (Make, Zapier, n8n, Google Drive), run history, and access from the Apify MCP server so AI agents can call it directly.
Why use the CSV to JSON Converter?
- Feed APIs and pipelines — convert exports from spreadsheets, banks, CRMs and analytics tools into JSON your code can consume.
- Give AI agents clean data — the output is compact structured JSON (no HTML, no nested junk), ideal for LLM tool use over the Apify MCP.
- Catch bad data early — supply a target JSON Schema and get a per-row validation report instead of silent corruption.
- Stop hand-writing parsers — delimiter sniffing, quoted fields, embedded newlines, ragged rows and encodings are handled for you.
How to use the CSV to JSON Converter
- Open the Input tab.
- Provide your CSV one of three ways: paste inline CSV text, add file URLs, or upload files (delivered via key-value-store keys).
- (Optional) Set a delimiter, toggle header/type inference, or paste a target JSON Schema to validate against.
- Click Start. Each input file becomes one dataset item you can download as JSON, CSV, Excel or HTML.
Input
| Field | Type | Description |
|---|---|---|
csvUrls | array | Public URLs of CSV files to download and convert. |
keyValueStoreKeys | array | Keys of uploaded files in the run's key-value store. |
csvText | array | Raw CSV strings passed inline (great for API / agent callers). |
delimiter | string | Force a delimiter. Blank = auto-detect , ; \t |. |
hasHeader | boolean | Treat the first row as column names (default true). |
inferTypes | boolean | Coerce to integer/number/boolean/null (default true). |
trimWhitespace | boolean | Strip whitespace from every cell (default true). |
nullValues | array | Values to treat as null (replaces the default set: empty, NA, N/A, null, nan, none). |
maxRows | integer | Cap data rows per file (0/blank = no cap). |
targetSchema | object | JSON Schema (Draft 2020-12) for a single row; enables per-row validation. |
Example input
{"csvText": ["id,name,active,score\n1,Ada,true,9.5\n2,Grace,false,8.0"],"inferTypes": true}
Output
Each input file produces one dataset item. You can download the dataset as JSON, CSV, Excel or HTML.
{"source": "csvText[0]","status": "ok","error": null,"rowCount": 2,"columnCount": 4,"columns": ["id", "name", "active", "score"],"records": [{ "id": 1, "name": "Ada", "active": true, "score": 9.5 },{ "id": 2, "name": "Grace", "active": false, "score": 8.0 }],"inferredSchema": {"$schema": "https://json-schema.org/draft/2020-12/schema","type": "array","items": {"type": "object","properties": {"id": { "type": "integer" },"name": { "type": "string" },"active": { "type": "boolean" },"score": { "type": "number" }}}},"validation": { "checked": false, "valid": true, "validRows": 2, "invalidRows": 0, "errors": [] },"meta": { "delimiter": ",", "hasHeader": true, "typesInferred": true, "encoding": "utf-8", "emptyRowsSkipped": 0, "raggedRows": 0 }}
Output fields
| Field | Description |
|---|---|
source | Where the file came from (URL, KVS key, or csvText[i]). |
status | ok when converted, error when unreadable/empty. |
rowCount / columnCount | Converted data-row and column counts. |
columns | Ordered column names (header names or field_N). |
records | The converted rows as typed JSON objects. |
inferredSchema | JSON Schema describing the records. |
validation | Per-row report vs your targetSchema (checked=false when none). |
meta | Delimiter, encoding, header flag, blank/ragged row counts. |
Pricing / How much does it cost?
This Actor is billed pay-per-result: one charge per file that converts into non-empty data. A file that is empty, unreadable, or has no data rows is returned with status: "error" and is never charged. See the Pricing tab for the current per-result rate. Converting a handful of files costs a fraction of a cent of platform compute; the value is in never writing another CSV parser.
Tips & advanced options
- Leading zeros are preserved. Values like
01234or00080stay strings so zip codes, phone numbers and IDs are never corrupted into integers. Type inference is per cell, so a column with mixed values (e.g.01234and90210) can contain both strings and integers — setinferTypes: falseto keep every value a string. - Ragged rows are lossless. Rows with more cells than the header get extra columns named
field_Nrather than dropping data. - Validation. Paste a
targetSchemato get avalidationblock flagging exactly which rows and fields don't match — without failing the whole run. - Big files. Each file is returned as one dataset item, and Apify caps a single item at ~9 MB. A file whose converted JSON would exceed that is returned as a clear (unbilled) size-cap error — use
maxRowsto convert it in smaller batches, or sample the top of a large file cheaply.
FAQ & support
- What formats can I export? JSON, CSV, Excel and HTML, from the dataset.
- Does it store my data? Only in your run's own dataset/key-value store, under your account.
- Known limitation: type inference is per-cell (see Tips). Column-level type unification is a planned option.
- Found a bug or want a feature? Use the Issues tab.