NV ToolkitFormat · Validate · Convert
Guide

What is a CSV File? The Format Everyone Uses and Nobody Reads About

CSV is the world's most-used data format and the least specified in practice: three rules, four decades of dialects, and one spreadsheet program that loves rewriting your values. Here's what actually matters.

In short

CSV (comma-separated values) is a plain-text tabular format with three rules: one record per line, fields separated by commas, and an optional header row. RFC 4180 defines the quoting: fields containing commas, quotes, or line breaks must be wrapped in double quotes, with embedded quotes doubled. It has no types and no nesting, which makes it ideal for flat records and risky to parse by hand.

By NaveenKumar T · Software engineer · builds and maintains NV Toolkit Published 2026-06-04 2 min read

The format in three rules

One record per line; fields separated by commas; first line conventionally the header. That's the core — and for clean data, that's the whole format. Its power is exactly this minimalism: every database, spreadsheet, language, and 40-year-old mainframe export tool can produce and consume it.

plaintext
sku,name,qty,price
KB-75,Mechanical Keyboard,1,149.99
MS-12,Wireless Mouse,2,39.50

Quoting: the part everyone gets wrong

RFC 4180's escape rules are tiny and constantly violated by hand-rolled code: a field containing commas, double quotes, or line breaks must be wrapped in double quotes, and quotes inside it are doubled (" → ""). That's it — there is no backslash escaping in CSV. The infamous failure is split(','): it shears 'Monitor, 27 inch' into two columns and corrupts every row after a quoted line break. Always parse CSV with a real parser; never with split.

plaintext
id,product,note
1,"Monitor, 27 inch","Customer said ""perfect"""
2,Keyboard,"Ships in
two packages"

The Excel problem

Excel is CSV's biggest producer and its most aggressive editor: it strips leading zeros (ZIP 01234 → 1234), converts long digit strings to scientific notation, rewrites dates into locale formats, and in some regions uses semicolons as the delimiter entirely. If a column must survive verbatim — IDs, phone numbers, codes — format it as text in the sheet before saving, or quote it in the source. Knowing this one paragraph prevents most real-world CSV corruption.

CSV vs JSON: when each wins

CSV is unbeatable for flat, tabular, homogeneous records — it's smaller than JSON for the same table, streams line-by-line, and opens in tools non-developers already use. It has no types (everything is text until interpreted), no nesting, and no standard encoding declaration. The moment records become hierarchical or fields become optional, JSON is the right container — and converting between the two is one click in either direction with our CSV to JSON and JSON to CSV converters, including automatic type detection on the way to JSON.

AspectCSVJSON
StructureFlat, tabularNested, hierarchical
TypesNone — everything is textTyped (string, number, boolean, null)
Size (same table)SmallerLarger — keys repeated per row
StreamingLine-by-lineNeeds the whole document, or a streaming parser
ToolingAny spreadsheetAny API or language
How this was tested: Syntax examples were validated with the site's own RFC 4180 CSV parser on 2026-09-10.

Sources

  1. RFC 4180 — Common Format for CSV Files
  2. IANA Media Types — text/csv
  3. Python docs — csv: CSV File Reading and Writing

Frequently asked questions

How do I open a CSV file?

Any spreadsheet (Excel, Google Sheets, Numbers) opens it as a table; any text editor shows the raw rows. For conversion into JSON, XML, YAML, or an HTML table — with proper quote handling — paste or drop it into our CSV tools.

What about semicolon- or tab-separated files?

Same family, different delimiter. European-locale Excel emits semicolons (because the comma is the decimal separator); TSV uses tabs and pastes beautifully into spreadsheets. Good parsers — including our converters — auto-detect the delimiter.

Does CSV support UTF-8?

The format is encoding-agnostic, which is the problem — nothing declares it. Modern convention is UTF-8; Excel historically wants a BOM to recognize it. If accented characters arrive as mojibake, the encoding (not the CSV) is what broke.

Drop any CSV into our converter — RFC 4180-correct parsing, automatic typing, and clean JSON out the other side.

Convert your CSV

Keep working

Related tools