Skip to content
TablePage.ai Open the app

CSV Comma-Delimited File Format: Prepare a Table for Sharing

Understand CSV structure, commas, quotes and encoding, then check your spreadsheet export before sharing it as a public dataset.

Share X in f
Wei Hu

To share a spreadsheet as a dataset, export a single, clean table—not the surrounding report layout. A CSV comma-delimited file is a plain-text table in which commas separate fields and line breaks separate records, except when a line break is inside a quoted field. CSV stands for comma-separated values. The Library of Congress describes it as a simple, text-based format for numeric and textual data.

The goal is a file that another application can read into the same columns and records, without shifting values or changing identifiers.

What a comma-delimited CSV looks like

Here is a fictional dataset with four columns and two data records:

record_id,organization,amount_usd,notes
00123,"Harbor Research, Inc.",1250.50,"Report marked ""final"""
00124,North Lab,0,

With the first record treated as a header, a CSV reader should interpret it as follows:

  • record_id, organization, amount_usd and notes are column labels.
  • Harbor Research, Inc. is one field, despite containing a comma.
  • The first note is Report marked "final"; doubled quotes represent literal quotation marks.
  • The second data record has an amount of 0 and an empty notes field. Those are different values.
  • 00123 is stored as text characters in the file. Whether an application preserves the leading zeros depends on how it imports that column.

The final comma in the second data record introduces its empty fourth field; removing it would leave only three fields.

The format rules that keep columns aligned

RFC 4180 documents the common comma-separated format. It is an informational reference, not a guarantee that every CSV application behaves identically.

For a dependable export:

  1. Use commas between fields. Spaces are part of a value, so do not add spaces after delimiters merely for appearance.
  2. Keep the same number of fields in every record, including the header.
  3. Use a header when publishing a reader-facing table. CSV permits an optional header, but clear labels make your dataset easier to interpret.
  4. Enclose fields containing commas, double quotes or line breaks in straight double quotes.
  5. Double each literal double quote inside a quoted field. Do not use backslashes as CSV quote escapes.

A quoted field can span multiple physical lines. Consequently, counting text lines is not a reliable way to count records, and splitting each line on every comma is not a reliable way to parse CSV. Use a CSV-aware reader. For more examples, see how to escape commas and double quotes.

What CSV does not preserve

CSV represents a simple table, not a workbook. It does not carry strong column-type definitions or rich dataset metadata. Keep descriptions of units, missing-value rules and sources alongside the published data. The Library of Congress recommends associated documentation, such as a codebook describing fields and their types.

Keep the original workbook if you need its formatting, formulas or other sheets. Excel’s CSV export saves only the current worksheet and warns that some workbook features are unsupported. Microsoft documents these export limitations.

Prepare and verify the file before publication

1. Make one rectangular table. Use one header row, one observation per record and one field per column. Remove report titles, presentation-only blank rows and explanatory footnotes from the data area. Put source and methodology notes beside the dataset instead.

2. Export a CSV copy. In Excel, use File > Save As and select CSV UTF-8 (Comma delimited) (*.csv) when available. Microsoft documents this UTF-8 save option. Preserve the original workbook. UTF-8 supports accented and non-Latin text; for other export options, see how to save a CSV with UTF-8 encoding.

3. Inspect the actual text. Check that field separators are commas. A .csv extension alone is not enough: Excel’s separator can change with regional settings. Do not globally replace semicolons with commas; punctuation inside values could be damaged. Microsoft explains delimiter settings.

4. Re-import deliberately. Choose the comma delimiter, confirm header handling and inspect the preview. Import identifiers such as 00123 as text to preserve their leading zeros. Compare headers, parsed data-record counts, identifiers, dates, blanks and numeric values with the source. Excel can interpret CSV columns using default data formats, so opening the file directly is not proof that values survived unchanged. Use the CSV export validation checklist.

5. Review the public result. Remove sensitive information before uploading. TablePage accepts CSV files and generates public, shareable dataset pages with filterable tables. After publication, check column alignment, representative values and filtering behavior on the page itself. Provide the source, reporting period, units and missing-value definitions wherever readers will find the dataset.