Data Formats

What Is a CSV File? Format, Structure, Examples, and Common Pitfalls

CSV is a family of plain-text tabular formats where records are rows and fields are separated by a delimiter, commonly a comma.

Published

CSV in one sentence

CSV means comma-separated values, but real systems use dialects with different delimiters, quoting rules, encodings and line endings.

Rows, columns and fields

name,note,active
Ada,"Hello, world",true
Lin,"Line 1
Line 2",false

Headers: common, useful, not magical

The first row often names columns, but the format itself does not universally guarantee that it is a header. Import settings and data contracts decide.

Delimiters and CSV dialects

ChoiceWhere it appears
CommaCommon CSV interchange
SemicolonLocales where comma is a decimal separator
TabTSV and spreadsheet copy/paste

Quotes, commas, newlines and escaped quotes

A quoted field may contain delimiters and line breaks. A literal quote inside a quoted field is commonly represented by two quotes.

id,note
1,"She said ""ready"""

What CSV does not preserve well

  • Nested objects and arrays
  • Strong numeric, boolean and null types
  • Multiple sheets, formulas and formatting
  • One universal encoding or dialect

Common pitfalls

  • Inconsistent field counts
  • Unescaped delimiters or newlines
  • Encoding mismatch
  • Spreadsheet auto-conversion of identifiers and dates

Try the example

See quoting in a real CSV preview

A comma and a line break require CSV quoting in the generated table.

[{name: Ada, note: Hello, world}, {name: Lin, note: Line 1\nLine 2}]

Expected result: The preview contains two rows and quotes fields containing comma or newline characters.

Try a real conversion

Create CSV from structured data

Preview columns, quoting and line breaks using the local JSON to CSV workflow.

Open JSON to CSV Converter →