A comma-separated values (CSV) (also sometimes called character-separated values) file stores tabular data (numbers and text) in plain-text form. Plain text means that the file is a sequence of characters, with no data that has to be interpreted as binary numbers. A CSV file consists of any number of records, separated by line breaks of some kind; each record consists of fields, separated by some other character or string, most commonly a literal comma or tab. Usually, all records have an identical sequence of fields.
A general standard for the CSV file format does not exist, but RFC 4180 provides a de facto standard for some aspects of it.
CSV is a common file format that is widely supported by consumer, business, and scientific applications. Among its most common uses is moving tabular data between programs that natively operate on incompatible (often proprietary and/or undocumented) formats. This works because so many programs support some variation of CSV at least as an alternative import/export format.
For example, a user may need to transfer information from a database program that stores data in a proprietary format, to a spreadsheet that uses a completely different format. The database program most likely can export its data as “CSV”; the exported CSV file can then be imported by the spreadsheet program.
“CSV” is not a single, well-defined format (although see RFC 4180 for one definition that is commonly used). Rather, in practice the term “CSV” refers to any file that:
is plain text using a character set such as ASCII, various Unicode character sets (e.g. UTF-8), EBCDIC, or Shift JIS,
consists of records (typically one record per line),
with the records divided into fields separated by delimiters (typically a single reserved character such as comma, semicolon, or tab; sometimes the delimiter may include optional spaces),
where every record has the same sequence of fields.
Within these general constraints, many variations are in use. Therefore “CSV” files are not entirely portable. Nevertheless, the variations are fairly small, and many implementations allow users to preview the first few lines of the file (which is feasible because it is plain text), and then specify the delimiter character(s), quoting rules, etc. If a particular CSV file’s variations fall outside what a particular receiving program supports, it is often feasible to examine and edit the file by hand or write a script or program to fix the problem.