CSV to JSON Converter
Paste CSV data and get pretty-printed JSON — supports delimiters, header toggle, and value trimming
Input & Settings
JSON Output
Output appears here
Paste CSV above or pick a sample
Examples
CSV with headers → array of objects
name,age,city
Alice,30,New York
Bob,25,Boston
// Output:
[
{ "name": "Alice", "age": "30", "city": "New York" },
{ "name": "Bob", "age": "25", "city": "Boston" }
]With the 'First row is header' toggle on, each subsequent row maps to a JSON object whose keys come from the header row.
Headerless CSV → array of arrays
Alice,30,New York
Bob,25,Boston
// Output:
[
["Alice", "30", "New York"],
["Bob", "25", "Boston"]
]With headers disabled, every row becomes a plain array of strings, preserving the original column order.
Details
This tool uses the PapaParse library to reliably parse CSV text in your browser. When 'First row is header' is enabled, each data row becomes a JSON object keyed by the header names. When disabled, rows become plain arrays. Auto-delimiter detection picks the right separator automatically, or you can force comma, semicolon, or tab. The trim option strips leading and trailing whitespace from every value before serialisation. All processing happens locally — your data never leaves your browser.
About this tool
CSV (Comma-Separated Values) is the most widely used tabular data format for spreadsheets, databases, and data exports. JSON (JavaScript Object Notation) is the dominant format for APIs and modern web applications. Converting between the two is a daily task for developers, data analysts, and backend engineers.
This tool uses PapaParse — the fastest and most reliable CSV parser for JavaScript — to handle edge cases like quoted fields containing commas, escaped characters, and mixed line endings. The result is always pretty-printed, valid JSON that you can paste directly into your code or API payload.
All processing happens locally in your browser. No data is uploaded to any server, making the tool safe for confidential datasets, internal CSVs, and personally identifiable information.
How to use
Convert a CSV with headers
Paste your CSV (or pick a sample chip), keep 'First row is header' on, then click Convert to JSON. Each data row becomes a JSON object keyed by the header values.
Parse a headerless CSV as arrays
Toggle 'First row is header' off before converting. Every row is output as a plain JSON array, useful when the CSV has no column names.
Use a custom delimiter
Open the Delimiter dropdown and choose Auto-detect, Comma, Semicolon, or Tab to match your file's separator.
Output shape by mode
| Mode | JSON output |
|---|---|
| Header on | [{"name":"Alice","age":"30"}] — array of objects keyed by header |
| Header off | [["Alice","30"]] — array of string arrays |
| Trim on | Leading/trailing whitespace removed from every value |
Frequently asked questions
Related tools
CSS Grid Generator
Visually build CSS Grid layouts — set columns, rows and gaps, see a live preview, and copy production-ready grid-template CSS.
Flexbox Playground
Visually configure a CSS flexbox container — set direction, alignment, wrap and gap, see a live preview, and copy production-ready CSS.
Border Radius Generator
Visually craft CSS border-radius values — including the advanced 8-value slash syntax for organic blob shapes — with a live preview and one-click copy.
Cubic Bezier / Easing Generator
Build a CSS cubic-bezier() timing function visually — drag control points, preview common presets, see the easing curve live, and copy the transition-timing-function CSS.
Barcode Generator
Generate barcodes in 8 formats (CODE128, EAN13, UPC, and more) — configure line width, height, and text display, then download as SVG or PNG.
HTML to Markdown Converter
Paste HTML and get clean Markdown. Configurable heading style, bullet marker, and code block style — all processed locally in your browser.