CSV Viewer

ConvertersCSV to JSON
CSVJSON

CSV to JSON Converter

Paste or upload a CSV to get JSON instantly. Array of objects or arrays, custom indentation — entirely in your browser.

No uploadNo signup100% private

CSV to JSON: output formats explained

Array of objects (recommended for APIs)

The default output. Each row becomes an object keyed by the column header:

[
  { "name": "John", "age": "25", "city": "New York" },
  { "name": "Mary", "age": "30", "city": "London" }
]

Use this for REST APIs, MongoDB imports, JavaScript state, React props, and anywhere a record is identified by its field names.

Array of arrays (compact format)

Each row is a plain array, with the first entry being the header row:

[
  ["name", "age", "city"],
  ["John", "25", "New York"],
  ["Mary", "30", "London"]
]

Smaller and faster to parse for very large datasets; useful when key ordering matters.

Use cases for CSV to JSON conversion

  • API ingestion: converting a CSV export into the payload for a POST request.
  • JavaScript apps: seeding mock data or fixtures from a spreadsheet.
  • MongoDB / Firestore: bulk-importing documents from a CSV.
  • Schema validation: running the JSON through Zod / JSON Schema to type the fields.
  • Charting libraries: many (Chart.js, Recharts, D3) consume JSON directly.

CSV vs JSON: when to use which

CSV is unbeatable for flat tabular data that will be consumed by humans or spreadsheets. JSON is better for hierarchical structures, mixed types, and anything that's going into code. Many pipelines keep CSV as the transport format (for size and universality) and convert to JSON at the API boundary. If you want a deeper refresher on the CSV side of that equation, see what a CSV file actually is.

Need to go the other way — take a JSON payload and flatten it back into a spreadsheet-friendly table? Our JSON to CSV converter handles nested objects and arrays without any config.

FAQ

How do I convert a CSV file to JSON?
Paste your CSV or upload a file, pick between array-of-objects and array-of-arrays output, then click Download. The conversion runs entirely in your browser.
Which output format should I pick?
Choose array of objects when each row is a record you want keyed by column name (the common case for APIs, databases, and most JavaScript apps). Choose array of arrays when you need a compact, ordered representation — useful for large datasets or matrix-style data.
Does it handle numbers and booleans correctly?
The converter keeps values as strings by default so you can decide. If you need typed values, run the JSON through a schema validator after conversion to coerce numbers, booleans and dates.
Is there a row limit?
No hard limit. The tool has been tested up to 100,000 rows without issue. Very large files may take a few seconds because output is rendered as a single JSON string.
Can it handle semicolon-separated files?
Yes. The parser auto-detects commas, semicolons and tabs.

Related tools