The .ods File That Is Valid, and That Your Reader Refuses
Published 9/15/2026 · 4 min read · File tools
Daniel Okonkwo — Front-end developer and tech writer at OneKitly
Web performance · File formats
Checked against 3 sources
An .ods is a zip archive holding a handful of XML files. The specification requires very few of them: a mimetype, a manifest and a content.xml are enough for a valid spreadsheet document, and styles.xml is explicitly optional. Minimal exporters take the specification at its word — scripts, generators and several online converters write exactly those three entries and stop. Some readers then refuse the document outright, reporting that they cannot find styles.xml, which reads like a corruption message and is not one: the file is right and the reader is strict. The fix here is to give the reader what it asks for without touching what it came for. When a workbook fails to open, the bytes are checked for a zip signature, unzipped, and if content.xml is present while styles.xml is absent, a minimal but valid styles.xml is added and the archive is read again. It adds no styling — three empty containers satisfy the requirement. The repair is attempted once, and if it fails the original error is raised rather than replaced, because hiding "file is encrypted" behind "incomplete ODS" sends you looking in the wrong place.
OpenDocument makes styles.xml optional. Several readers demand it and reject the whole document without it — "Cannot find file styles.xml in zip" on a file that is not broken.
Optional in a specification is not optional in practice
This is a recurring shape in file formats and worth recognising when you meet it elsewhere. A specification says a part may be omitted; the reference implementation always writes it; every reader is then tested against files that always contain it; and the optionality quietly becomes theoretical. The first file that exercises it is reported as corrupt. The honest response is to accept it — the file satisfies the standard — while writing the missing part when producing one, because a document that only some readers open is worse than one with three empty style containers nobody looks at.
Which format to hand over
ODS when the person on the other end uses LibreOffice or Collabora, when an administration asks for an open format, or when the file is going into an archive where a documented specification matters more than which program is fashionable. XLSX when the recipient uses Excel or a corporate pipeline built around it, which is most of the time. Both hold the same things for ordinary tables — cells, sheets, formulas, number formats — and both are zip archives of XML, so neither is the more open in any meaningful sense today. Where they diverge is at the edges: pivot tables, macros and the more exotic chart types survive their own format and not the other one.
| Entry in the zip | Holds | Required by the spec |
|---|---|---|
| mimetype | The document's type, uncompressed and first | Yes |
| META-INF/manifest.xml | The list of the other entries | Yes |
| content.xml | The cells, the sheets, the values | Yes |
| styles.xml | Fonts, borders, page setup | No — and this is the one that gets demanded |
| meta.xml, settings.xml | Author, dates, window positions | No |
Frequently asked questions
- Does the repair change my data?
- No. It adds one entry to the archive and leaves every other entry byte for byte as it was — content.xml, the manifest and the mimetype are untouched. The added file declares three empty containers and no style at all, so nothing about how the document looks is being decided for you. It also happens only in memory, on the copy being read; the file on your disk is not modified.
- My .ods still will not open. What else could it be?
- The original error is the one to read, and it is deliberately not replaced by the repair attempt. The usual causes are a password-protected document, a file that is not a zip at all — a renamed .xls, or a download that saved an HTML error page under the right extension — and a truncated transfer. Checking the size against the source is the fastest of those to rule out.
- Can I open an .ods and save it back as .ods?
- Yes, and that is one way to make a minimal file readable everywhere: read it here and write it out again, and the result carries the parts a strict reader expects. Bear in mind that a round trip through any converter keeps the cells and drops most of the presentation — a rewritten file is a clean table, not a copy of your document.
Articles you may find interesting
All guides →Related tools
Sources
Spotted a mistake in this article?