Developer

Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers

ToolOrbit Engineering 2 min readUpdated
Why CSV Is Tricky to Parse: Delimiters, Quotes and Headers

CSV is the most widely used exchange format for spreadsheets, exports and tabular data. But converting it to JSON by hand is error-prone when fields contain commas, quotes, or newlines. This guide shows how to turn CSV into safe JSON objects or arrays and why the ToolOrbit CSV to JSON Converter is the right tool for the job.

Why CSV is tricky to parse

  • Comma-separated values are easy until a field contains a comma.
  • Quoted fields can contain embedded newlines or quotation marks.
  • Different systems use commas, semicolons or tabs as delimiters.
  • Headers, blank lines, and escaped quotes all change how the file should be read.

How the converter works

ToolOrbit detects the delimiter automatically, honors quoted fields, and converts each row into either a JSON object keyed by the header row or a raw array. This means you can use it for CSV exports from Excel, Google Sheets, databases and analytics tools without worrying whether the file is comma-separated or semicolon-separated.

name,age,city
Ada,36,London
Alan,41,Paris

Choose the right output shape

  • Array of objects: the default for structured JSON, using the header row as keys.
  • Array of arrays: useful when the data has no header row or when you need pure row lists.
  • Preserve quoted values exactly so commas inside fields do not split the row.
Tip: If your CSV has a header row, choose the object output shape. It makes the JSON easier to query and less fragile to column order changes.

Common mistakes to avoid

  • Treating commas inside quotes as field separators.
  • Using a fixed comma delimiter when the file actually uses semicolons or tabs.
  • Ignoring blank lines at the end of the file, which can produce empty JSON rows.
  • Assuming all rows have the same number of fields; the converter reports mismatches.

Privacy and convenience

This converter runs entirely in your browser, so sensitive spreadsheet exports never leave your computer. Paste your CSV, verify the detected structure, and copy the clean JSON output in one step.

Delimiters, headers and raw reality

CSV arrives semicolon-separated in Europe, tab-separated from many exports, and with headers that occasionally vanish. A robust converter detects the delimiter, and when there are no headers it numbers the columns (col_0, col_1…) instead of guessing names. Values that look like numbers should convert as numbers (so API payloads stay type-correct) while codes preserved as strings — things like postal codes, which must not lose leading zeros. That is the difference between a shape that parses and a shape that preserves what the spreadsheet meant.

Kludge-averse folks: paste a Google Sheets export straight in — it is usually comma+quote CSV that “just works” with the auto-detect defaults.

Tools mentioned

More reading

View all guides
What Is Base64? How Encoding Works and Common Mistakes
Developer

What Is Base64? How Encoding Works and Common Mistakes

What Base64 encoding actually does, where it is used, and the mistakes that cause broken or oversized output.

2 min readUpdated
encodeURI vs encodeURIComponent: Which One to Use
Developer

encodeURI vs encodeURIComponent: Which One to Use

How percent-encoding works, the difference between encoding a whole URL and a single component, and the mistakes that break links.

2 min readUpdated
What Is a UUID? Version 4 vs Version 7 Explained
Developer

What Is a UUID? Version 4 vs Version 7 Explained

What a UUID looks like, why version 4 is the safe default, when version 7 is better, and best practices for IDs.

2 min readUpdated
How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption
Developer

How SHA-256 and SHA-512 Hashes Work: Hashing vs Encryption

What a hash function does, how to choose between SHA-256 and SHA-512, and why hashing is not encryption.

2 min readUpdated
What Is a JWT? Header, Payload and Signature Explained
Developer

What Is a JWT? Header, Payload and Signature Explained

A JSON Web Token has three parts. Learn what the header, payload and signature contain, how to read the claims, and why decoding is not verifying.

2 min readUpdated
What Is HTML Encoding? Entities & Escaping Explained
Developer

What Is HTML Encoding? Entities & Escaping Explained

Learn how HTML encoding works, why escaping prevents XSS and layout breaks, and how to encode and decode named, decimal, and hex entities.

2 min readUpdated
Unix Time Explained: Seconds, Milliseconds and Time Zones
Developer

Unix Time Explained: Seconds, Milliseconds and Time Zones

What a Unix timestamp is, how to tell seconds from milliseconds, how time zones come into it, and the values worth recognising.

2 min readUpdated
Binary, Octal, Decimal and Hex: How Number Bases Work
Developer

Binary, Octal, Decimal and Hex: How Number Bases Work

How positional number bases work, why very large values need exact arithmetic, and the hex and binary values you meet every day.

2 min readUpdated