Formats

XLSX, CSV, ODS, XML or Numbers: which spreadsheet format to use

How XLSX, CSV, ODS, XML Spreadsheet 2003 and Apple Numbers differ inside, what each one keeps (formulas, styles, sheets, types) and which to pick for a job.

Use XLSX when the file is a working model that someone will open in Excel or another full spreadsheet program. Use CSV when you are moving one table of values into a database, a script or another system. Use ODS when the recipient works in LibreOffice or you want an ISO-standard container. Use Numbers only inside the Apple ecosystem, and XML Spreadsheet 2003 only when an older tool asks for it.

What each format is

Format Extension Container Specification
XLSX .xlsx ZIP archive of XML parts Office Open XML: ECMA-376, ISO/IEC 29500
CSV .csv Plain text, one line per row RFC 4180 (informational, written after the fact)
ODS .ods ZIP archive of XML parts OpenDocument: OASIS ODF, ISO/IEC 26300
XML Spreadsheet 2003 .xml One uncompressed XML file Microsoft's SpreadsheetML schema
Numbers .numbers Package of compressed binary files Proprietary, not published by Apple

XLSX

An XLSX file is a ZIP archive. Unzip one and you find xl/workbook.xml (the sheet list), xl/worksheets/sheet1.xml (the cells), xl/styles.xml (fonts, fills, number formats) and xl/sharedStrings.xml (each distinct text value, stored once). A formula cell stores the formula text and the last calculated result, so a program that cannot calculate can still show a number.

Excel introduced the format in 2007 and its limits are 1,048,576 rows by 16,384 columns (column XFD) and 32,767 characters per cell. The older .xls format stopped at 65,536 rows and 256 columns. XLSX cannot carry macros; that is what .xlsm is for.

CSV

A CSV file is text: one record per line, values separated by commas, with quotes around any value that contains a comma, a quote or a line break. There is no type information, no formulas, no styles and only one table per file.

Two things vary from file to file because the format never fixed them: the delimiter (many European locales use a semicolon, because the comma is their decimal separator) and the character encoding. Older versions of Excel often need a UTF-8 byte order mark to recognize UTF-8 text. The open CSV in Excel without breaking data article covers the import side in detail.

ODS

OpenDocument Spreadsheet is the native format of LibreOffice Calc. Like XLSX it is a ZIP of XML (content.xml, styles.xml, meta.xml, settings.xml), with a mimetype entry stored first and uncompressed so tools can identify the file without unpacking it. ODF became ISO/IEC 26300 in 2006. Formulas are stored in OpenFormula syntax, for example of:=SUM([.A1:.A10]). A "flat" variant, .fods, puts everything into a single readable XML file.

XML Spreadsheet 2003

This is Microsoft's SpreadsheetML from Office XP and 2003: one XML file with a Workbook root, a Worksheet per sheet, Row and Cell elements, and a Data element with an ss:Type attribute (Number, String, DateTime, Boolean or Error) holding each value. Formulas sit in an ss:Formula attribute in R1C1 notation. It is not the XML inside an XLSX file, and it is not arbitrary XML data. Excel still opens and saves it as "XML Spreadsheet 2003 (*.xml)", and LibreOffice can open it. Any script can read it with a plain XML parser, without unzipping anything.

Apple Numbers

Since the 2013 rewrite, a .numbers file is a package whose contents are .iwa files: compressed Protocol Buffers messages. Apple has not published the schema, so outside Apple's own apps the format is read by reverse-engineered libraries. Numbers 2009 files used XML inside a package, which is a different and older layout. Numbers runs on Mac, iPhone, iPad and in a browser through iCloud; there is no Windows app (see how to open a Numbers file on Windows).

What survives in each format

Feature XLSX CSV ODS XML 2003 Numbers
Multiple sheets Yes No Yes Yes Yes
Formulas Yes, with cached result No, values only Yes Yes Yes
Styles and number formats Yes No Yes Yes Yes
Typed values (number, text, date, boolean) Yes No, all text Yes Yes Yes
Charts and images Yes No Yes No Yes

Two details deserve attention.

CSV writes what the cell displays. A cell holding 1250.5 formatted as currency is written as "$1,250.50", with the dollar sign, the thousands separator and the quotes. A value formatted to two decimals loses its other digits. Dates are written in whatever display format the cell uses, so 10/08/2026 means different days to different readers. For a CSV that other software will read, switch the columns to plain number and ISO date formats (yyyy-mm-dd) first. The XLSX to CSV conversion guide walks through this.

Formulas are portable only if the functions are. Every format above except CSV keeps the formula text, but a function that exists in one program and not another turns into an error in the second. A model that uses XLOOKUP or dynamic arrays will not recalculate in an older copy of Excel, and Numbers has its own function set. Sheet Reserve restricts its templates to functions that Excel, LibreOffice, Google Sheets and Numbers all evaluate the same way, which is why its formulas survive a download in every format that stores formulas. The loan amortization schedule is an example: in XLSX, ODS, XML or Numbers its payment cell is a live PMT formula, and in CSV it is a bare number. A table of values such as GDP by country has no formulas to lose, so CSV costs it nothing.

Which programs open which format

Format Excel LibreOffice Calc Google Sheets Numbers
XLSX Native Opens and saves Imports and exports Opens and exports
CSV Opens Opens, with an import dialog Imports and exports Opens and exports
ODS Opens and saves, with some loss Native Imports and exports No
XML 2003 Opens and saves Opens No No
Numbers No Partial import No Native

This reflects each program's documented import and export lists. Check your own file in the target program, because fidelity is thinnest at the edges of the table; charts, conditional formatting and fonts are the usual casualties when a file crosses between Excel, LibreOffice and Numbers. For ODS in Google Sheets, see does Google Sheets open ODS files.

Size and version control

File size depends on the data, so here is a measurement rather than a rule. The test sheet has 20,000 rows and 6 columns (a date, a text label, an integer, a price, a formula and an order number), saved from LibreOffice 26.2:

Format File size
CSV 979 KB
CSV compressed with gzip 310 KB
XLSX 963 KB
ODS 934 KB
Flat ODS (.fods) 21.9 MB

The XLSX and ODS files are close to the CSV only because they are compressed: unzipped, the XLSX held 8.9 MB of XML and the ODS content.xml alone was 19.3 MB. The test data was random, which compresses poorly; real tables with repeated labels shrink more. XML Spreadsheet 2003 is uncompressed and wraps every cell in tags, so it lands in the flat-ODS class, far above XLSX.

For version control the picture is the reverse. CSV is line-based text, so Git shows exactly which rows changed and can merge edits. XLSX, ODS and Numbers are archives of machine-written XML or binary data; Git stores each save as an opaque binary file and a diff shows nothing useful. If you need reviewable history for a model, commit a CSV export of the data next to the workbook, or save the workbook as flat ODS, which is text. Keep rows in a stable sort order or every diff will be noise.

Row limits and large files

Excel stops at 1,048,576 rows. A CSV with more rows opens in Excel with a warning that the data does not fit; only the first 1,048,576 rows load, and saving that workbook discards the rest. Do not round-trip very large CSV files through it. Google Sheets caps a spreadsheet at 10 million cells. Recent LibreOffice versions match Excel's grid. Past a million rows, use a database or a script, and feed it with CSV.

Choosing a format

You need to Use Why
Send a working model with formulas to Excel users XLSX Formulas, styles, types and sheets all travel
Load one table into a database, R or Python CSV (UTF-8) Every tool reads it; no container to unpack
Share with LibreOffice users or archive in an ISO format ODS Native there, open standard
Track changes in Git CSV, or flat ODS Text diffs
Keep formulas but parse the file with a plain XML reader XML Spreadsheet 2003 One text file, no ZIP
Work on Mac, iPhone and iPad Numbers Native on Apple devices
Upload to Google Sheets XLSX or ODS; CSV for a single table Keeps formulas and sheets
Handle more than 1,048,576 rows CSV into a database or script A sheet cannot hold them

The XLSX versus CSV page gives the short version of the first two rows, and what is an XML spreadsheet explains the one most people have never met.

A checklist

  • Choose by what the recipient's program can open, not by what you use.
  • Keep one master in XLSX or ODS and export CSV from it when needed, never the reverse.
  • Before exporting CSV, set dates to yyyy-mm-dd, remove merged cells and keep one header row.
  • Save CSV as UTF-8, and check the delimiter if the recipient's locale uses decimal commas.
  • After any conversion, open the result in the target program and compare a total, the row count and one date column against the original.
  • If a file will pass through several programs, test it with the formulas you actually use. Sheet Reserve members can download any sheet in all five formats, generated in the browser (how files are converted), so you can try each one.

Keep reading