CSV → JSON
Convert CSV data to a JSON array. The first row is used as the header.
About CSV to JSON Conversion
Converting CSV to JSON is a fundamental data processing operation in modern web development and data engineering. Common scenarios include loading CSV datasets into JavaScript applications, transforming spreadsheet exports for REST API consumption, migrating tabular data to NoSQL databases (MongoDB, Firestore), and pre-processing data for visualization libraries like D3.js or Chart.js.
CSV Format Reference
CSV files exported from different tools often have subtle variations: Excel adds a UTF-8 BOM (byte order mark), uses semicolons as delimiters in European locales, and may quote all fields. Google Sheets always uses commas and UTF-8 without BOM. Database exports (MySQL, PostgreSQL) follow RFC 4180 more strictly.
Type inference during CSV-to-JSON conversion requires careful handling: numeric strings (phone numbers, ZIP codes, IDs with leading zeros) may be incorrectly converted to numbers, losing the leading zeros. Dates in various formats (MM/DD/YYYY vs ISO 8601) remain as strings unless explicitly parsed. Empty cells can represent either empty strings or null values depending on context. This tool converts empty cells to null, numbers and booleans to their native JSON types, and everything else to strings.