Developer Tools

CSV Explained: Working With Comma-Separated Data

Learn how CSV works, and the quoting rule that keeps commas inside a value from breaking the whole row.

Brekzy Team Published September 8, 2026

On this page
  1. What Is CSV?
  2. A Simple Example
  3. The Quoting Problem
  4. Common Mistakes
  5. Use the CSV Converters

CSV is one of the simplest data formats there is, rows of data separated by commas, but that simplicity hides a genuine gotcha: what happens when the data itself contains a comma?

What Is CSV?

CSV (Comma-Separated Values) represents tabular data as plain text: each line is a row, and commas separate the values within that row. The first row commonly holds column headers. It’s widely supported by spreadsheet software, databases, and countless other tools, making it a common export and import format.

A Simple Example

name,city,age
John,London,30
Priya,Mumbai,27

The Quoting Problem

What happens when a value itself contains a comma? Written naively, it would break the row into the wrong number of columns. The standard solution is to wrap that specific value in double quotes:

name,city,age
"Smith, John",New York,45

The quotes tell a CSV parser that the comma inside “Smith, John” is part of the data, not a column separator.

If a value contains a literal double quote character, it’s typically escaped by doubling it ("") inside the quoted field, another detail that trips up hand-written CSV.

Common Mistakes

  • Not quoting fields that contain commas. This silently shifts every value after it into the wrong column, without necessarily causing an obvious error.
  • Assuming CSV has one single universal standard. The delimiter (comma vs semicolon in some locales), quoting rules, and text encoding can all vary between the tools that produce and read CSV files.
  • Ignoring encoding mismatches. A CSV file saved in one text encoding but opened assuming another can silently corrupt special characters and accented letters.

Use the CSV Converters

The CSV to JSON Converter and JSON to CSV Converter convert between CSV and What Is JSON? instantly, handling the quoting rules correctly for you.

Try it yourself

CSV to JSON Converter

Try our CSV to JSON Converter →

Frequently Asked Questions

What does CSV stand for?

Comma-Separated Values.

How do you handle a comma inside a CSV value?

Wrap the entire value in double quotes, so a parser knows the comma inside it is data, not a column separator.

Is CSV the same everywhere?

Not entirely. While the basic comma-and-newline structure is consistent, the exact delimiter, quoting rules, and text encoding can vary slightly between different tools and regional conventions.

Can CSV store nested or hierarchical data?

Not naturally. CSV is built around flat, tabular rows and columns; formats like JSON or XML are better suited to genuinely nested data structures.

How do I escape a double quote inside a CSV value?

Double it. A value like She said "hi" becomes "She said ""hi""" when quoted for CSV.

Explore More

Find the right tool, or keep reading Brekzy's other guides.