CSV to JSON Converter
Convert CSV data to JSON format instantly. Paste text or upload a .csv file.
No data sent to serverRelated Tools
What is CSV to JSON?
CSV (Comma-Separated Values, RFC 4180) is the universal tabular format — supported by Excel, Google Sheets, every database, every BI tool. JSON (RFC 8259) is the universal hierarchical format — used by virtually every web API and modern application.
Common conversion scenarios: importing spreadsheet data into web apps, seeding databases from Excel exports, preparing API request bodies from CSV exports, mocking API responses for testing, migrating legacy data from spreadsheets to NoSQL.
Conversion example
# CSV input
name,age,email
Alice,30,alice@example.com
Bob,25,bob@example.com
# JSON output
[
{ "name": "Alice", "age": "30", "email": "alice@example.com" },
{ "name": "Bob", "age": "25", "email": "bob@example.com" }
]The first row becomes JSON keys; each subsequent row becomes an object. Numbers are kept as strings unless the tool detects pure numeric columns and converts.
CSV gotchas to know
- Embedded commas:
“Smith, John”→ quoted strings preserve commas - Embedded quotes:
“He said ”“hi”“”→ doubled quotes inside quoted strings - Newlines in fields: quoted strings can span multiple lines (RFC 4180)
- Excel encoding: Excel saves CSV in CP1252/UTF-8-BOM by default — paste raw or save as “CSV UTF-8” to avoid mojibake
- Empty fields:
a,,b→ middle field is empty string, not null - Delimiter variations: regional settings sometimes use semicolons (
;) instead of commas (Europe)
How to Use
- Paste CSV data or upload a
.csvfile. - Click Convert.
- Review the JSON output — verify field names and values.
- Copy or download as
.json.
Privacy: Conversion runs in your browser. No upload.
Two Formats Built for Different Jobs
CSV is a table: rows and columns, nothing more. It has been the lowest common denominator of data exchange since the 1970s because every spreadsheet, database, and analytics tool reads it. Its weakness is that it cannot express structure — there is no way to say that a customer has several addresses, or that an order contains a list of items.
JSON is a tree. It nests, it distinguishes a number from a string from a boolean, and it is what essentially every web API speaks. That is why this conversion exists: data arrives from a spreadsheet as CSV and has to go somewhere that expects JSON.
The conversion is straightforward in one direction and lossy in the other. Going CSV to JSON, each row becomes an object keyed by the header names. Going back, any nesting has to be flattened or dropped.
The Traps That Break Naive Conversions
Commas inside values. A field containing “Smith, John” must be quoted, or it splits into two columns. Any parser that simply splits on commas gets this wrong, which is why so many hand-rolled scripts corrupt address data.
Quotes inside quoted values. CSV escapes a quotation mark by doubling it, which looks strange but is the actual convention.
Line breaks inside a field. A multi-line address can legitimately contain newlines inside a quoted value, so counting lines is not the same as counting records.
Everything is a string. CSV has no types. The value 007 could be a number or a product code where the leading zeros matter, and 2024-01-05 could be a date or text. Automatic type detection is convenient right up until it converts a postcode or a phone number into a number and eats the leading zero.
Inconsistent column counts. Real exports often contain rows with missing trailing fields, which shifts everything if handled carelessly.
FAQ
Does it handle quoted fields?
Yes — quoted fields with embedded commas, quotes (escaped as “”), and line breaks parse correctly per RFC 4180.
What if my CSV uses semicolons instead of commas?
Excel in some European locales (Germany, France) saves with semicolons. Replace semicolons with commas before pasting, or open in Excel and re-export with comma delimiter.
Are numbers converted to numeric JSON?
By default values are strings. The tool may auto-detect pure-numeric columns and convert. For mixed columns (some rows have IDs like “001”), keeping as strings prevents leading-zero loss.
Will my Excel file work?
Excel .xlsx is binary, not CSV. First save in Excel as CSV (UTF-8) — File → Save As → CSV UTF-8 (Comma delimited). Then paste or upload.
How big can the CSV be?
Limited by browser memory — files up to ~50 MB process smoothly. For multi-GB CSV, use command-line tools like csvkit or stream parsers (papaparse in Node.js).
Is my data sent to a server?
No — all processing runs in your browser. Safe for confidential customer data, financial records, or sensitive datasets.
Are numbers converted to numbers or kept as text?
Values that look numeric become JSON numbers. Watch out for identifiers such as zip codes and product codes with leading zeros, where that behaviour loses information — those are usually better quoted in the source CSV.
What happens to commas inside a value?
Properly quoted fields are parsed correctly, so a value like “Smith, John” stays a single field. Unquoted commas in the source will split the field, which is a problem with the CSV rather than the conversion.
Can I produce nested JSON?
Not directly. CSV is flat, so each row becomes a flat object. Building nested structures requires deciding how columns map onto a hierarchy, which is a job for a script rather than a general converter.
Does the first row have to be a header?
Yes — the header row supplies the property names for each object. Without it there is nothing sensible to call the fields.
Is my data uploaded?
No. Parsing and conversion happen entirely in your browser, which matters when the CSV contains customer or financial data.
⚠️ Reference Only
Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.
Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.