ODT Read Directly, Not Converted to DOCX
An .odt file is a zip archive of XML in the OpenDocument Format (ODF). Paragraphs are text:p elements in content.xml. Tables use table: elements. Headers and footers sit inside style:master-page in styles.xml. None of this lines up neatly with Word's w: elements.
Many parsers handle ODT by running LibreOffice to convert it to DOCX or PDF first, which loses any structure the conversion cannot carry. AILANG Parse reads the ODF XML directly and returns the same block format you get from DOCX. Nothing is converted or rendered.
soffice --headless --convert-to), which adds 2–5 seconds per file and can lose structure. AILANG Parse reads the file directly, in milliseconds, with nothing else to install.Raw ODF XML vs Structured Output
<office:body>
<office:text>
<text:h text:outline-level="1">
Q1 Plan
</text:h>
<text:p text:style-name="Normal">
Revenue target: 2.4M EUR
</text:p>
<table:table table:name="Targets">
<table:table-row>
<table:table-cell
table:number-columns-spanned="2">
<text:p>Region</text:p>
</table:table-cell>
<table:table-cell>
<text:p>Q1</text:p>
</table:table-cell>
</table:table-row>
</table:table>
<text:list>
<text:list-item>
<text:p>EMEA</text:p>
</text:list-item>
</text:list>
</office:text>
</office:body>
{
"metadata": {
"title": "Q1 Plan",
"author": "Alice Chen",
"created": "2026-03-15T09:00:00Z"
},
"blocks": [
{
"type": "heading",
"level": 1,
"text": "Q1 Plan"
},
{
"type": "text",
"text": "Revenue target: 2.4M EUR",
"style": "normal"
},
{
"type": "table",
"headers": [
{"text": "Region", "colSpan": 2},
{"text": "Q1"}
],
"rows": [...]
},
{
"type": "list",
"ordered": false,
"items": ["EMEA"]
}
]
}
What Gets Extracted
Headings & Outline
Every text:h element becomes a heading block with its level (1–6), taken from text:outline-level. You can rebuild the document outline from the headings alone.
Paragraphs & Styles
text:p elements become text blocks that keep their style name. Inline text and images anchored to a paragraph stay at their place in the text.
Tables & Merged Cells
Each table:table keeps its rows and columns. Cells merged across columns (table:number-columns-spanned) are marked with colSpan. Header rows are identified the same way as for DOCX.
Lists
text:list elements become list blocks. Empty items are left out. Nested list items come out as individual entries.
Headers, Footers & Text Boxes
Headers and footers, which ODT keeps in style:master-page in styles.xml, come out as section blocks. Each text box (draw:text-box) is its own section block, at the point in the text where it is anchored.
Images & Metadata
Embedded images (draw:image) come with their path in the file (xlink:href) and file type (MIME type). Metadata comes from meta.xml: dc:title, dc:creator, dc:date, and the page count from meta:document-statistic.
Headers & Footers
Unlike DOCX, ODT keeps headers and footers with the style definitions, not in the body. They sit in style:master-page elements inside styles.xml. AILANG Parse reads styles.xml as well and returns each header or footer as a section block with kind: "header" or "footer".
{
"type": "section",
"kind": "header",
"blocks": [
{"type": "text", "text": "Confidential — Internal Only", "style": "normal"}
]
}
Tables & Merged Cells
ODF marks a cell merged across columns with table:number-columns-spanned on the first cell of the merge. AILANG Parse reports merges as colSpan/rowSpan on each cell, the same table format it uses for DOCX, so your code can treat ODT and DOCX tables alike.
{
"type": "table",
"headers": [
{"text": "Region", "colSpan": 2, "rowSpan": 1, "merged": false},
{"text": "Total", "colSpan": 1, "rowSpan": 1, "merged": false}
],
"rows": [
[{"text": "EMEA"}, {"text": "UK"}, {"text": "€125K"}],
[{"text": "EMEA"}, {"text": "DE"}, {"text": "€98K"}]
]
}
Use Cases
European Public Sector
EU government bodies and many national administrations standardise on ODF for procurement, contracts and policy documents. Because the files are read directly, you can process these archives without running LibreOffice servers.
Mixed-Office Environments
Organisations where some people use LibreOffice end up with mixed DOCX and ODT archives. One parser and one output format cover both, so your code does not need a separate path for each file type or a conversion that may lose structure.
Academic Manuscripts
Researchers using LaTeX or Zotero often produce ODT exports. Extract the heading hierarchy, citation tables and figure references without converting to Word format first.
Document Migration
Convert older ODT archives to Markdown for docs-as-code, HTML for web publishing, or DOCX for colleagues who use Word. Headings, tables and images survive the conversion.
Compliance & Records
ODF is the standard for long-term document preservation in many jurisdictions because the format is open. Because the files are read directly, you can index, search and audit ODF archives without first converting them to a proprietary format.
Browser-Based Tools
ODT parsing can run inside the browser (using WebAssembly), so you can build review tools that never upload a file. Drop an ODT into the Workbench: it is parsed in your browser tab and never leaves your device.
Try It
Workbench (in-browser)
Drop an ODT file into the Workbench. It is parsed in your browser by the same parser the CLI uses. No upload, no signup.
CLI
# Parse an ODT file
docparse report.odt
# Convert ODT to Markdown
docparse report.odt --convert output.md
# Convert ODT to DOCX
docparse report.odt --convert output.docx
API
curl -X POST https://docparse.ailang.sunholo.com/api/v1/parse \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "filepath=@report.odt" \
-F "outputFormat=blocks"
Python SDK
from ailang_parse import DocParse
client = DocParse(api_key="YOUR_API_KEY")
result = client.parse_file("report.odt")
print(result.metadata.title)
for block in result.blocks:
if block.type == "heading":
print("H" + str(block.level), block.text)
elif block.type == "table":
print("Table:", len(block.rows), "rows")
Parse in Browser API Reference
Frequently Asked Questions
How do I parse an ODT file to JSON?
Does AILANG Parse need LibreOffice installed?
No. content.xml, styles.xml and meta.xml are read directly from the .odt file. LibreOffice (soffice) is never run.
What ODT elements are extracted?
Headings (text:h with outline level), paragraphs (text:p), tables with merged cells (table:number-columns-spanned), lists (text:list), images (draw:image), text boxes (draw:text-box), sections, headers and footers from style:master-page, and metadata from meta.xml.
Are headers and footers extracted?
Yes. ODT stores headers and footers in style:master-page elements inside styles.xml. AILANG Parse reads styles.xml as well and returns each header or footer as a section block.
Does ODT parsing run in the browser?
Yes. Drop an .odt into the Workbench and it is parsed in your browser tab (using WebAssembly) by the same parser the CLI uses. The file never leaves your device.
How is ODT different from DOCX parsing?
Both are zip archives with XML inside, but the XML is different. DOCX uses Office Open XML (w: elements). ODT uses the OpenDocument Format (text:, table: and office: elements). AILANG Parse reads both directly and returns the same block format for each. See DOCX parsing for the Word equivalent.