Data converters · 5 min read
CSV to JSON: from a spreadsheet to structured data
CSV looks like the simplest format in computing and behaves like one of the trickiest. A CSV to JSON conversion is where those hidden rules surface: a comma inside a quoted field, a semicolon delimiter from a European spreadsheet, a column of numbers that should stay text. Knowing what the parser is doing turns a failed import into a two-minute fix.
Updated
The header row becomes your keys
The first row supplies the JSON property names and every following row becomes an object. That means header hygiene is schema design: spaces, duplicate names and punctuation in headers produce keys you cannot comfortably consume. Rename to `snake_case` or `camelCase` before converting, and confirm no two columns share a name — a duplicate header is silently overwritten in most implementations.
Everything in CSV is a string
CSV has no types at all, so a converter decides how to interpret each column. Numbers become numbers so you can do arithmetic; `true`/`false` become booleans; empty fields become `null` or an empty string depending on your choice. The trap is identifiers: postal codes, phone numbers, invoice numbers and version strings like `1.10` must remain strings, or you lose leading zeros and trailing significance. If a column looks numeric but is an identifier, keep it as text.
Quotes, commas and newlines
RFC 4180 solved this decades ago: if a field contains a comma, a quote or a line break, it is wrapped in double quotes, and internal quotes are doubled. Any compliant parser — Papa Parse is the one bundled here — handles wrapped fields with embedded commas and multi-line cells without a second thought. A parser that splits on commas naively will produce columns that shift as soon as one address field contains a comma, which is the classic “why is my data offset by one” bug.
Delimiters vary by locale: spreadsheets in many European locales export semicolon-separated files, and TSV uses tabs. If every row collapses into one long key, the delimiter is wrong — pick semicolon or tab and re-run.
Where CSV files come from (and what they carry)
Exports from analytics tools, CRM systems, billing platforms and databases are the most common source — and they routinely contain customer names, emails and revenue figures. Converting locally keeps that data off the network entirely. The YamlBox CSV to JSON converter parses in the browser, lets you choose the delimiter and type handling, and keeps working with the network disabled.
Sizing expectations
A CSV file is roughly one JSON object per line, so the converted document is larger — keys repeat on every row, and pretty-printing adds indentation on top. For a file large enough to make your browser pause, converting an array of objects and then minifying gives the smallest practical result, and converting to JSON Lines (one object per line, no array) is the right shape if a stream or a log pipeline is the next consumer.
CSV to JSON — frequently asked questions
Why are numbers in my CSV coming through as strings?
CSV stores no types, so the converter decides per column. If a value looks numeric it is usually converted, but identifiers with leading zeros or trailing points need to stay strings. Look for a type-inference setting and keep identifier columns as text.
Can I convert a semicolon-delimited file?
Yes — set the delimiter to semicolon. Many European spreadsheet exports use semicolons when the decimal separator is a comma, and a CSV parser expecting commas will otherwise return one column containing the whole row.
Is it safe to convert CSV with customer data in the browser?
It is safer than uploading it. A client-side conversion never transmits the file, so an export containing emails or revenue figures stays on your machine, and the tool continues to work offline — which is easy to verify by disconnecting and converting again.
Tools mentioned in this post
Keep reading
5 min read
JSON to CSV: flattening nested data without losing meaning
Convert JSON to CSV with nested objects flattened into columns, consistent headers and Excel-safe quoting — and know which shapes should not be flattened at all.
6 min read
Excel to JSON: turning workbooks into structured data
Convert Excel to JSON in the browser from XLSX workbooks — headers, date serials, formulas and multiple sheets explained, with nothing uploaded.
5 min read
Markdown tables: generate them instead of counting pipes
Build GitHub-flavoured markdown tables from rows or spreadsheets — alignment, escaping pipes, and when a table is the wrong choice for your README.