Tabular Data Standard.csvMIME: text/csv

CSV Format Specification: The Universal Tabular Data Interchange Standard

Understand RFC 4180 field delimiters, quoting escaping rules, CRLF line endings, and converting CSV to JSON.

Comma-Separated Values (CSV) is a plain-text format for storing tabular data (numbers and text) where each line represents a data record and each record consists of fields separated by commas. Despite its simplicity, CSV remains the undisputed universal interchange format for database exports, spreadsheet applications (Excel, Google Sheets), and machine learning pipelines.

Format Specification & Header Signature

Core file signatures, developer metadata, and standard RFC specifications:

Magic Bytes (Hex Signature)Plain Text (ASCII / UTF-8)
MIME Media Typetext/csv
Standard / SpecificationRFC 4180
Initial Developer / OrganizationStandardized under RFC 4180 (1972 (RFC 4180 published 2005))
RFC StandardRFC 4180 (Common Format and MIME Type for CSV Files)
Field DelimiterComma (,), with Semicolon (;) in European locales
Record DelimiterCRLF (\r\n) standard, LF (\n) on Unix
Escaping MechanismDouble double-quotes (""escaped"") for fields containing commas

Operating System & Browser Compatibility Matrix

Where .csv is natively supported without third-party codecs:

Platform / EnvironmentNative SupportImplementation Notes
All Operating Systems, Spreadsheets & DatabasesSupportedSupported natively across 100% of programming languages, Excel, Sheets, and SQL databases.

Advantages of Comma-Separated Values

  • •Universal compatibility: supported by every data processing tool on Earth
  • •Ultra-compact plain text format free of bloated XML/JSON styling metadata
  • •Effortless streaming and line-by-line parsing without loading entire datasets into memory

Limitations & Trade-Offs

  • •No standardized data typing: numbers, strings, and dates are stored as raw text
  • •Regional delimiter confusion: European countries often use semicolons due to comma decimals
  • •Lacks native support for hierarchical or nested object data structures

RFC 4180 Escaping Rules Explained

The most frequent source of bugs in CSV processing is handling fields that contain commas or line breaks. RFC 4180 dictates that any field containing a delimiter, quotation mark, or newline MUST be enclosed in double quotes.

If a quoted field contains a literal double-quote character, that quote must be escaped by preceding it with another double-quote (`"He said ""Hello"""`).

Frequently Asked Questions about Comma-Separated Values

How do I convert a CSV file to JSON in the browser?

Use DocSwift's free client-side CSV to JSON converter. It parses CSV headers and rows into structured JSON arrays instantly with zero server uploads.