Convert CSV to JSON
4 output modes,
types inferred.
Free CSV to JSON converter. Array of objects, keyed object, raw arrays or column arrays. Auto-detects delimiter, coerces numbers and booleans. Runs entirely in your browser — your CSV never leaves your device.
Three steps — paste your CSV and get structured JSON in seconds.
Paste CSV text directly or upload a .csv file. JSONshift auto-detects the delimiter — comma, semicolon, tab or pipe — and shows a live preview table of your data before you convert.
Select how you want the JSON structured: array of objects (standard), keyed object (first column as key), array of arrays (raw), or column arrays (charting-ready). Toggle type coercion to turn numeric strings into real JSON numbers.
Click Convert and copy the JSON to clipboard or download a .json file. The output is valid JSON that works directly with any API, database, JavaScript app or pandas read_json().
What the converter does with your tabular data.
A CSV file is a flat table: rows of values separated by a delimiter, with an optional header row. JSON is a hierarchical format that can represent the same table as an array of objects — where each row becomes a JSON object and each column header becomes a key. This is the most common output mode and works directly with REST APIs, MongoDB, pandas and JavaScript front-ends.
Type coercion is the other critical step. In a CSV, every value is a string — the number 42 is stored as the text "42". When you load a CSV into a JavaScript application or a database, you typically want numbers as actual JSON numbers — otherwise arithmetic and sorting break. JSONshift's coercion converts numeric strings to numbers, true/false to JSON booleans, and empty strings or null to JSON null.
Delimiter detection works by scanning the first line of the CSV and counting occurrences of each candidate character. The character with the highest consistent count across rows wins. This handles most real-world CSV files correctly — including European semicolon-separated exports and tab-delimited data from spreadsheet applications.
Common workflows where JSON is more useful than flat CSV.
Most REST APIs accept JSON payloads, not CSV. Converting a spreadsheet export to a JSON array lets you POST it directly to an API endpoint, seed a database, or use it as fixture data in a test suite — without writing a parser script.
Chart libraries (Chart.js, D3, Recharts), data tables and React/Vue components all expect JSON. Converting CSV data to column arrays or array of objects lets you drop it directly into your component as a prop or imported module.
MongoDB's mongoimport accepts JSON Lines (NDJSON). Converting a CSV export to JSON array — then one step further to JSONL — lets you import rows as documents directly, with correct types preserved in the process.
While pandas reads CSV natively, converting to JSON first is useful when you need to inspect the type inference, share the data with a JavaScript colleague, or load it via pd.read_json() into a pipeline that expects JSON input.
Four ways to structure your CSV data as JSON.
| Mode | Output shape | Best for |
|---|---|---|
| Array of objects | [ {"id":1,"name":"Alice"}, … ] |
REST APIs, MongoDB inserts, pandas read_json(), most JavaScript use cases. Each row is a self-describing object with named keys. |
| Keyed object | { "1": {"name":"Alice"}, … } |
Lookup tables where you need O(1) access by ID. The first column becomes the key — useful for config files and dictionaries. |
| Array of arrays | [ ["id","name"], [1,"Alice"], … ] |
Compact representation that includes the header row as the first array. Used by Google Sheets API, some charting libraries and matrix operations. |
| Column arrays | { "id":[1,2], "name":["Alice","Bob"] } |
Columnar format ideal for Chart.js, Plotly, D3 and analytics libraries that expect separate arrays per data series rather than one object per row. |
Other free converters you might need next.
CSV parsed in
your browser. No upload.
The entire conversion runs in JavaScript locally. Your CSV is parsed by your own browser — it is never transmitted to any server, never stored, and gone the moment you close the tab.
The output is valid JSON — verified against the ECMA-404 standard. Pretty-printed output uses consistent 2-space indentation. Minified output has no whitespace, ideal for API payloads where byte count matters.
