CSV ↔ JSON Converter

Turn exported spreadsheets into JSON arrays ready for APIs, or convert JSON responses into CSV to open in Excel and Google Sheets.

CSV

JSON

[
  {
    "id": 1,
    "name": "Jane Doe",
    "email": "[email protected]",
    "active": true
  },
  {
    "id": 2,
    "name": "Smith, John",
    "email": "[email protected]",
    "active": false
  }
]

Use via API

Converts CSV to JSON or JSON to CSV.

POSThttps://enhanced.dev.br/api/v1/convert/csv-json
JSON body parameters
Body (JSON)TypeDescription
input *string | array | objectCSV as text, or JSON (text or value) when direction is json-csv.
direction"csv-json" | "json-csv"Default: "csv-json".
delimiter"auto" | "," | ";" | "\t" | "|"Default: "auto".
headerbooleanFirst CSV row is a header. Default: true.
typedbooleanConverts numbers, booleans and null. Default: true.

Request example

curl -X POST "https://enhanced.dev.br/api/v1/convert/csv-json" \
    -H "Content-Type: application/json" \
    -d '{"input":"id,nome,ativo\n1,Ana,true\n2,João,false","direction":"csv-json"}'

Response

{
  "ok": true,
  "data": {
    "direction": "csv-json",
    "delimiter": ",",
    "output": [
      {
        "id": 1,
        "nome": "Ana",
        "ativo": true
      },
      {
        "id": 2,
        "nome": "João",
        "ativo": false
      }
    ]
  },
  "meta": {
    "version": "v1"
  }
}
  • Errors return { ok: false, error: { code, message } } with an HTTP 4xx/5xx status.
  • Free, no API key required. Limited to 120 requests per minute per IP.
  • CORS enabled: call it straight from the browser on any domain.

How to use

  1. Choose a direction: CSV → JSON or JSON → CSV.
  2. Paste your data; the delimiter is detected automatically (comma, semicolon, tab or pipe).
  3. For CSV → JSON, set whether the first row is a header and whether numbers and booleans should be inferred.
  4. Use Swap to convert the result back and check the round trip.
  5. Copy or download the converted file.

Use cases

  • Importing customer or product spreadsheets into database seeds.
  • Exporting API results for analysis in spreadsheets.
  • Converting CSV files from European Excel locales, which use semicolons as separators.
  • Generating test fixtures from tabular data.

Technical concepts

RFC 4180 and quoted fields

Fields containing the delimiter, quotes or line breaks must be wrapped in double quotes, and inner quotes are doubled (""). The parser on this page implements these rules, including line breaks inside fields and CRLF line endings.

Type inference

When enabled, values such as 42, 3.14, true, false and null become native JSON types. Numbers with leading zeros (ZIP code 02134) and integers above JavaScript's safe limit stay as strings so no information is lost.

Nested JSON in CSV

CSV is flat. When converting JSON → CSV, the columns are the union of every object's keys, and nested values (objects or arrays) are serialized as JSON inside the cell.

Frequently asked questions

Why does Excel open my CSV in a single column?

In locales that use a comma as the decimal separator, Excel expects semicolons. Generate the CSV with the ; delimiter to open it directly.

Are rows with a different number of columns accepted?

Yes. Missing columns become empty strings; extra columns without a header are ignored in header mode.

Do duplicate or empty headers lose data?

No. They are renamed to column_N, so no column overwrites another.

Related tools