The basics
What is an OTS file?
An OTS file is a template for LibreOffice Calc and other OpenDocument spreadsheet apps. Invoices, budgets, timesheets, expense claims and order forms are typical OTS templates. Open one and LibreOffice doesn't open the file itself: it creates a new spreadsheet called Untitled 1 with a copy of the template's sheets, formulas, styles and print settings, and the template stays unchanged for next time.
Inside, an OTS is built exactly like an ODS: XML files in a ZIP package, defined by the OpenDocument standard (OASIS, ISO/IEC 26300). It is the spreadsheet member of the ODF template family, next to OTT for text and OTP for presentations. Microsoft Excel's equivalent is the XLTX.
- It holds structure, not just data. Labels, formulas, number formats, cell styles, validation rules and print ranges are the useful part; the input cells are often empty.
- The type is inside the file. LibreOffice decides whether a file is a template from the
mimetypeentry, not from the.otsextension. - Formulas come along. A new spreadsheet made from the template calculates as soon as you type into it.
Anatomy
What's inside an OTS file
Rename an .ots to .zip and it opens like any archive. Our sample-minimal.ots holds only the three entries LibreOffice needs, written by hand: a sheet with a label, an empty input cell and a formula that uses it.
$ unzip -l sample-minimal.ots
Length Date Time Name
--------- ---------- ----- ----
55 2026-10-27 12:00 mimetype
1268 2026-10-27 12:00 content.xml
421 2026-10-27 12:00 META-INF/manifest.xml
Bytes 0-92: 50 4B 03 04 … "mimetype"
"application/vnd.oasis.opendocument.spreadsheet-template"
content.xml:
<office:document-content xmlns:office="…" xmlns:table="…" office:version="1.3">
<office:body>
<office:spreadsheet>
<table:table table:name="Sheet1">
<table:table-column table:number-columns-repeated="2"/>
<table:table-row>
<table:table-cell office:value-type="string"><text:p>Price</text:p></table:table-cell>
<table:table-cell/>
</table:table-row>
<table:table-row>
<table:table-cell office:value-type="string"><text:p>VAT 21%</text:p></table:table-cell>
<table:table-cell table:formula="of:=ROUND([.B1]*0.21;2)"
office:value-type="float" office:value="0"><text:p>0</text:p></table:table-cell>
</table:table-row>
…
</table:table>
</office:spreadsheet>
</office:body>
</office:document-content>
META-INF/manifest.xml (root entry):
<manifest:file-entry manifest:full-path="/" manifest:version="1.3"
manifest:media-type="application/vnd.oasis.opendocument.spreadsheet-template"/>- 1
50 4B 03 04 - 2
mimetypeThe mimetype entry
First in the package, stored uncompressed and without an extra field, so its name always sits at byte 30 and its content at byte 38.
- 3
application/vnd.oasis.opendocument.spreadsheet-templateThe template's type
55 characters, no line break. An ODS has the 46-character
application/vnd.oasis.opendocument.spreadsheethere; the extra-templateis what makes the file a template. - 4
<office:spreadsheet>A spreadsheet
The body holds spreadsheet content, as in an ODS. There are no template-only elements: the template's sheets are ordinary
table:tableelements. - 5
<table:table-cell/>An empty input cell
Where the user types the price. A template usually leaves its input cells empty, or fills them with example values to type over.
- 6
table:formula="of:=ROUND([.B1]*0.21;2)"A formula
Written in OpenFormula with an
of:prefix, cell references in square brackets and semicolons between arguments. It refers to the empty cell, so it shows 0 until a price is typed in. - 7
office:value="0"The stored result
Each formula cell also stores its last result, so a viewer that can't calculate still shows something. LibreOffice recalculates when a new spreadsheet is made from the template.
- 8
manifest:full-path="/"The manifest's root entry
Repeats the package's type. In a valid file it matches the
mimetypeentry:…spreadsheet-templatehere.
Under the hood
What makes an OTS different from an ODS
We saved our invoice from LibreOffice Calc twice, as sample-invoice.ots and sample-invoice.ods, and compared the two packages entry by entry. Everything except two entries was byte for byte identical:
| Entry | In the OTS | In the ODS |
|---|---|---|
mimetype | …opendocument.spreadsheet-template (55 bytes) | …opendocument.spreadsheet (46 bytes) |
META-INF/manifest.xml, root entry | …spreadsheet-template | …spreadsheet |
content.xml, styles.xml, meta.xml, settings.xml, thumbnail | Identical | Identical |
Because the type is inside the package, the extension doesn't decide. In our tests with LibreOffice 24.2, the OTS renamed to .ods still opened as Untitled 1, a new spreadsheet, while the ODS renamed to .ots opened as an ordinary file under its own name. To turn one into the other, save it again in the other format.
Template features
What a good spreadsheet template holds
Our sample-invoice.ots uses the features that make spreadsheet templates hard to break. Each one is stored in the XML, so other apps can read it, and converters can lose it:
| Feature | What it does | Where it is stored |
|---|---|---|
| Input cells | Yellow cells for the things that change: client, date, lines. They use a cell style called Input. | styles.xml: the Input style, with style:cell-protect="none" |
| Protected formulas | Every other cell is locked and the sheet is protected without a password, so a user can't type over a formula by accident. | content.xml: table:protected="true" on the sheet |
| Formulas that tolerate blanks | =IF(OR(B10="";C10="");"";B10*C10) leaves empty lines empty instead of showing 0. | table:formula on each cell |
| Validation | Quantity and price must be numbers of 0 or more; anything else is refused with a message. | table:content-validation in content.xml |
| Number formats | Euro amounts and a long date format, so typed values look right at once. | Data styles in styles.xml and content.xml |
| Print range and page style | A4 portrait, with a footer, printing only A1:D26. | table:print-ranges and the page style |
Protection is not security
Sheet protection without a password stops accidents, not people: anyone can switch it off with Tools, Protect Sheet. Even with a password, the data is readable by unzipping the file. Use it to guide users, never to hide anything.
In LibreOffice
Making and using spreadsheet templates in LibreOffice Calc
- Make a template: set up the sheets, then File, Templates, Save as Template, give it a name and pick a category. Or use File, Save As with the type ODF Spreadsheet Template (.ots) and save it anywhere.
- Use a template: File, New, Templates opens the template dialog; double-click a template. Double-clicking an
.otsin your file manager does the same. - Edit a template: in the template dialog, right-click it and choose Edit. Opening the
.otsthe normal way only gives you a new spreadsheet. - Change the default: right-click a template and choose Set as Default. Every new Calc spreadsheet then starts from it, the job
Book.xltxdoes in Excel's start-up folder. - Leave input cells empty or obviously fake. Our invoice has two example lines to type over; the budget template has no values at all, so its totals start at €0.00.
Comparison
OTS vs XLTX, XLT and ODS
| OTS | XLTX | XLTM | XLT | ODS | |
|---|---|---|---|---|---|
| What it is | ODF spreadsheet template | Excel template | Excel template with macros | Excel 97-2003 template | ODF spreadsheet |
| Native app | LibreOffice Calc | Microsoft Excel | Microsoft Excel | Excel 97-2003 | LibreOffice Calc |
| Structure | ZIP of XML | ZIP of XML | ZIP of XML | OLE2 binary | ZIP of XML |
| What marks a template | mimetype entry | Main part content type | Main part content type | A flag in the workbook | (not a template) |
| Formula syntax in the file | OpenFormula, of:=SUM([.A1:.A3]) | Excel's, SUM(A1:A3) | Excel's | Binary tokens | OpenFormula |
| Macros | Yes, same extension | No | Yes | Yes, same extension | Yes, same extension |
Use OTS when the people filling in the template use LibreOffice, and XLTX when they use Excel. Formulas are translated on conversion, so test a converted template in the app that will use it: we converted sample-invoice.ots to XLTX with LibreOffice and the formulas and the sheet protection came through.
How to
How to open and convert an OTS file
- LibreOffice Calc (free; Windows, macOS, Linux) opens OTS files natively, as do Apache OpenOffice and other ODF spreadsheet apps. Collabora Office does the same on phones and tablets.
- To a spreadsheet: open the template (which creates Untitled 1) and save it as ODS or XLSX, or run
soffice --headless --convert-to ods budget.ots. - To an Excel template: File, Save As, Excel 2007-365 Template (.xltx), or
soffice --headless --convert-to 'xltx:Calc MS Excel 2007 XML Template' invoice.ots. - From a spreadsheet or Excel template:
soffice --headless --convert-to 'ots:calc8_template' invoice.ods(an XLSX or XLTX works as input too). - Excel and Google Sheets work with ODS spreadsheets. For a template, the dependable route is to create a spreadsheet from it in LibreOffice and send that, or convert the template to XLTX.
- In a browser: browsers can't display OTS files, so a link to one downloads it.
Troubleshooting
Common OTS problems and how to fix them
- Opening the template gives Untitled 1. That's how templates work. To change the template itself, use Edit in the template dialog.
- "The cell or chart you are trying to change is protected." The template locks its formula cells. Type in the input cells, or switch protection off with Tools, Protect Sheet if you made the template.
- Totals show 0 or Err:502. An input is empty or text instead of a number. Formulas that test for blanks, as in our invoice, avoid the zeros; validation stops text being typed into number cells.
- My template isn't in the template dialog. It's not in a templates folder. Use Import in the template dialog, or Save as Template.
- "The file is corrupt" after editing the ZIP by hand. The
mimetypeentry must be first and uncompressed. With Info-ZIP:zip -X0 new.ots mimetypethenzip -Xr new.ots . -x mimetype. - It downloads as a ZIP or opens as the wrong type. The server sends
application/zip. Serve.otsasapplication/vnd.oasis.opendocument.spreadsheet-template.
Security
Is an OTS file safe to open?
Like ODS, an OTS has no separate macro-free extension: any .ots can contain LibreOffice Basic or other scripts, and spreadsheets made from it carry them on. LibreOffice's default macro security only runs macros that are signed by a trusted source or stored in a trusted location. Don't lower it because a template asks you to.
- External links. Formulas can pull data from other files or web addresses (
WEBSERVICE, links to external sheets). LibreOffice asks before updating external links; say no for templates you didn't make. - Hidden sheets and cells. A template can carry hidden sheets, hidden rows and comments into every file made from it. Check them before sending a filled-in copy outside your organisation.
- Formula injection. Data pasted from a CSV into a template can start with
=and become a formula. Treat imported text as text.
Free downloads
Sample OTS files to download
Free sample OpenDocument spreadsheet templates for testing uploads, file-type detection, converters and template handling. The invoice and the budget were built in LibreOffice Calc 24.2; the minimal file was written by hand. All were checked with unzip -t, odfpy and a LibreOffice export to PDF. None contains macros, and all names are fictional.
Browsers can't show this kind of file in a page. Download it to open it in the app it belongs to.
What's inside sample-invoice.ots
Browsers can't preview OTS files, so download it and open it in LibreOffice Calc: you get Untitled 1, a new invoice based on it. These are the parts to look for.
Yellow input cells
Client, invoice number, date, payment terms, ten invoice lines and the VAT rate. They use the Input and Money Input cell styles, which leave them unlocked.
Locked formulas
The sheet is protected without a password, so only the yellow cells take typing. Tools, Protect Sheet switches it off.
Line amounts
=IF(OR(B10="";C10="");"";B10*C10)on each line: empty lines stay empty. Two example lines give a subtotal of €402.00.VAT and total
=ROUND(D21*B22;2)for 21% VAT and=D21+D22for the total, €486.42 with the example lines.A calculated due date
=IF(D5="";"";D5+D6)adds the payment terms to the invoice date: 26 November 2026. A sentence below joins text and cells with&.Validation
Quantity and unit price refuse anything that isn't a number of 0 or more, with a message.
Print setup and metadata
A4 portrait, print range
A1:D26, a footer line, and the description "Free sample from 99helpers.com/file-types/ots" inmeta.xml.
All sample OTS files
Invoice template
sample-invoice.ots · 27.9 KB (28,529 bytes)
A one-page invoice: input cells in a cell style, locked formula cells on a protected sheet (no password), formulas for amounts, VAT, total and due date, validation and a print range.
- Checking that an app creates a new spreadsheet from a template
- Testing formulas and sheet protection in converters
The same invoice as an ODS
sample-invoice.ods · 27.8 KB (28,514 bytes)
Saved from the same Calc document as the OTS. Only the
mimetypeentry and the manifest's root entry differ.- Comparing a template with a spreadsheet
- Testing code that must tell OTS from ODS
Blank 12-month budget template
sample-budget.ots · 26.3 KB (26,887 bytes)
Income and expense categories by month with no values: row and column totals, a balance that turns red when negative (conditional formatting), a savings rate, three named ranges and a second sheet that uses them.
- Testing conditional formatting and named ranges
- Converting a template to XLTX
Minimal OTS, three entries
sample-minimal.ots · 967 bytes
Only
mimetype,content.xmlandMETA-INF/manifest.xml, written by hand: one empty input cell and one formula. It's the file shown in the anatomy above.- Parser tests: don't assume optional parts exist
- Checking detection by the mimetype entry
Ways to test with them
- File type detection: all four start with
PKand havemimetypeat byte 30. Read from byte 38: the three OTS files say…spreadsheet-template, the ODS says…spreadsheetfollowed by other data. - New file, not the template: opening
sample-invoice.otsshould give an untitled spreadsheet. An app that saves over the template has a bug. - Formulas in conversion: convert
sample-invoice.otsto XLSX or XLTX and check the total is still €486.42 and the due date still 26 November 2026. - Protection and validation: in the converted file, try typing over a total and typing text into a quantity. Both should be refused.
- Defensive parsing:
sample-minimal.otshas nostyles.xml,meta.xmlorsettings.xml. Code that assumes they exist will fail on it.
Free to use for testing, teaching and demos, commercially or not, with no attribution needed. A link back to this page is always appreciated.
Put it online
Have an OTS file? Give it a link.
Drop a LibreOffice spreadsheet template on 99helpers and it gets its own link, ready to share with your team. Browsers can't display OTS files, so visitors download it and open it in LibreOffice Calc, which starts a new spreadsheet from it.
Questions
OTS files, frequently asked
What is an OTS file?
An OpenDocument spreadsheet template, the template format of LibreOffice Calc. Opening it creates a new, untitled spreadsheet with the template's sheets, formulas and styles.
What's the difference between OTS and ODS?
Inside, only the type in the mimetype entry and the manifest: …spreadsheet-template instead of …spreadsheet. In use, an ODS opens itself, while an OTS starts a new spreadsheet.
How do I open an OTS file?
With LibreOffice Calc or another ODF spreadsheet app such as Apache OpenOffice. Double-clicking it creates a new spreadsheet from it.
How do I edit an OTS template?
In LibreOffice, open File, Templates, Manage Templates, right-click the template and choose Edit. Make the changes and save.
Can Excel open OTS files?
Excel works with ODS spreadsheets. For a template, convert it in LibreOffice to XLTX, or create a spreadsheet from it and save that as XLSX.
How do I convert an OTS to XLSX or XLTX?
In LibreOffice, save it as Excel 2007-365 Template (.xltx), or create a spreadsheet from it and save that as XLSX. On a server: soffice --headless --convert-to xlsx file.ots.
Why can't I type in some cells?
The template protects its formula cells. Type in the input cells; if you made the template, switch protection off with Tools, Protect Sheet.
Can an OTS file contain macros?
Yes. OTS has no separate macro-free extension. LibreOffice blocks unsigned macros by default; keep that setting for templates you didn't make.
Related formats
Other file types explained
Keep going
Related
Sources
- OASIS: OpenDocument Format v1.4, Part 1: Introduction
- IANA media type registration for OTS
- Apache OpenOffice: MIME content types used by OpenOffice.org
- Library of Congress: OpenDocument Format (ODF) family
Last reviewed 27 October 2026.