RFC 4180 / START HERE
CSV records, before the details
CSV: Comma-Separated Values
CSV is a simple text format for rows and fields. This RFC documents a common CSV format and its media type; actual CSV files can vary.
The idea in one picture
A table has rows and fields
CSV writes them as text
Another tool imports the table
A simplified picture of the idea; the chapters explain the actual mechanisms.
Why it exists
Spreadsheets and other programs need a basic interchange format for tabular data, including rules for commas and quotes inside fields.
A familiar example
You export a contact list from a spreadsheet and import its rows into another application.
Helpful background
You can start here without reading another RFC. If these ideas are unfamiliar, these short introductions may help.
What you’ll learn next
Begin with chapter one, or choose a topic.
- Records and fieldsCSV organizes records as rows with comma-separated fields.→
- Optional header rowThe first row may contain names for the fields.→
- Quoted fieldsDouble quotes keep commas or line breaks inside one field.→
- Escape double quotesA quote inside a quoted field is represented by two consecutive double quotes.→
- Media type and application limitstext/csv describes a textual interchange format, not a complete typed schema.→
This introduction explains RFC 4180 (2005). Read the original RFC ↗