Skip to content

CSV to JSON converter

CSV to JSON runs through our table engine, producing an array of objects keyed by the detected or supplied header row.

  • Converted with Table engine · nothing stored
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • Delimiter Changed

    Comma, semicolon, tab, and pipe files are auto-detected before parsing; override the delimiter when a sample row contains ambiguous punctuation.

  • Header row Kept

    With the header option on, the first row becomes object keys; with it off, generated column names are used so every row is still emitted.

  • Types Changed

    Type inference converts values such as true, 42, and 1,234.50 to booleans or numbers unless you turn it off for IDs and codes.

  • Empty cells Changed

    Blank cells become JSON null instead of empty strings, making omitted spreadsheet data explicit for APIs.

  • BOM Changed

    A UTF-8 byte order mark is stripped from the first header name so the output key is name, not name.

  • Output shape Changed

    The result is always a top-level array of objects; there is no enclosing dataset object unless you add one after download.

  • Formatting Changed

    The pretty option writes indented JSON for review; compact output keeps the same values with fewer bytes.

Sample conversions

Orders with thousands separators

Input
CSV: sku,active,total\nA-100,true,"1,234.50"\nB-200,false,19.99
Output
Pretty JSON: [{"sku":"A-100","active":true,"total":1234.5},{"sku":"B-200","active":false,"total":19.99}]. Turn type inference off if those totals must remain strings.

European decimal pitfall

Input
Semicolon CSV: product;price;zip\nLamp;"1.234,50";02134
Output
JSON keeps price as "1.234,50" because the decimal comma is locale-specific; ZIP 02134 stays text only when type inference is off or the column is protected.

Excel BOM export

Input
UTF-8 BOM CSV from Excel: name,email\nAda Lovelace,ada@example.com
Output
JSON key is "name" after the BOM is stripped, avoiding the invisible first-key bug in downstream code.

A real CSV → JSON run

We converted our CSV sample (226 B) with Table engine on 2026-09-11. It took 1 ms and produced a 614 B JSON file, 2.7× larger than the input. The engine raised no warnings.

Input · sample.csv · 226 B

4 data rows × 5 columns; header: company,stage,arr,owner,close_date

Rows
4
Columns
5
Header
company,stage,arr,owner,close_date

Output · sample.json · 614 B

Array of 4 objects; keys: company, stage, arr, owner, close_date

Records
4
Keys
company, stage, arr, owner, close_date

First lines of the output

json
[
  {
    "company": "Northwind Traders",
    "stage": "Proposal",
    "arr": 48000,
    "owner": "R. Ayers",
    "close_date": "2026-10-14T00:00:00.000Z"
  },
  {
    "company": "Contoso Ltd",
    "stage": "Negotiation",
    "arr": 120000,
    "owner": "P. Ng",
    "close_date": "2026-09-30T00:00:00.000Z"
  },
  {
    "company": "Fabrikam",
    "stage": "Qualified",
…

Options and when to change them

delimiter
Leave on auto for comma, semicolon, tab, or pipe files; set it manually when quoted numbers make the detector guess wrong.
header
Turn on for normal CSV tables so output objects use real field names; turn off for raw row data without headers.
typeInference
Keep on for API-ready booleans and numbers; turn off for ZIP codes, SKUs, employee IDs, and any value where leading zeros matter.
pretty
Use pretty JSON for debugging or copy-paste review; disable it before uploading very large payloads.

Do it yourself

pandas

bash
python - <<'PY'
import pandas as pd
pd.read_csv("in.csv").to_json("out.json", orient="records", indent=2)
PY

pandas may infer ZIP codes as integers unless you pass dtype for those columns.

jq with csv header

bash
jq -R -s '
  split("
") | map(select(length > 0) | split(",")) as $rows |
  $rows[0] as $header |
  $rows[1:] | map([ $header, . ] | transpose | map({(.[0]): .[1]}) | add)
' in.csv > out.json

This simple jq filter is not a full CSV parser; quoted delimiters require a CSV-aware tool.

CSV to JSON by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Table engine); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=csv&to=json.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.csv" -F "from=csv" -F "to=json" \
  -F 'options={"delimiter":","}' \
  --output output.json

Options this engine accepts for CSV → JSON

KeyApplies toTypeDefault
delimiterReading CSVstring,
headerReading CSVbooleantrue
quoteReading CSVstring"
encodingReading CSVutf-8 · latin1utf-8
delimiterWriting JSONstring,
newlineWriting JSON ·
sheetNameWriting JSONstring
dialectWriting JSONpostgres · mysql · sqlitepostgres
tableNameWriting JSONstringdata
createTableWriting JSONbooleantrue
API reference

When this is the wrong conversion

  • Do not use CSV to JSON to preserve spreadsheet formulas, comments, colors, or merged cells; use XLSX output for workbook features.
  • If the source uses locale-specific decimals such as 1.234,50, normalize the column before relying on numeric inference.
  • For newline-delimited event streams, convert JSONL directly instead of wrapping everything into one JSON array.

CSV to JSON questions

Why did 02134 become 2134?

Type inference treats numeric-looking cells as numbers. Turn typeInference off before converting postal codes, account numbers, or other identifiers with leading zeros.

What happens to blank CSV cells?

Blank cells are emitted as null so downstream JSON consumers can distinguish missing values from a deliberate empty string.

Can it detect semicolon or tab CSV files?

Yes. Auto-detect checks comma, semicolon, tab, and pipe delimiters. Override the delimiter when the preview shows shifted columns.