Home

Formats

Introduction

Stencila supports a range of document and data formats via codecs. Each codec converts to and from the Stencila schema, enabling bidirectional conversion between formats where supported.

Codecs architecture

Codecs encode external formats into Stencila's schema nodes and decode them back again. This mirrors Pandoc's approach: conversion goes through a canonical internal representation so any format with both directions can convert between each other. Some codecs are fully lossless (for example, JSON, CBOR, YAML), while others are lossy because the source format lacks structure for all Stencila nodes.

Testing and examples

Stencila uses property testing to exercise codec round-trips and detect regressions; see rust/codecs/tests/proptests.rs for the property test suite. The examples/conversion folder contains snapshots of Stencila node types serialized into various formats, which are used for regression testing and documentation.

Formats

FormatDefault extensionDocs
AT Protocol JSONatproto.jsonAT Protocol JSON
CBORcborCBOR
CBOR+ZstdczstCBOR+Zstd
CSL-JSONcslCSL-JSON
CSVcsvCSV
Citation File FormatcffCitation File Format
DOM HTMLdom.htmlDOM HTML
DebugdebugDebug
Email HTMLemail.htmlEmail HTML
HTMLhtmlHTML
IPYNBipynbIPYNB
JATSjats.xmlJATS
JSONjsonJSON
JSON+Zipjson.zipJSON+Zip
JSON-LDjsonldJSON-LD
JSON5json5JSON5
Koenig JSONkoenigKoenig JSON
LLM MarkdownllmdLLM Markdown
LaTeXlatexLaTeX
Lexical JSONlexicalLexical JSON
MJMLmjmlMJML
MarkdownmdMarkdown
MecamecaMeca
Microsoft ExcelxlsxMicrosoft Excel
Microsoft Excel (XLS)xlsMicrosoft Excel (XLS)
Microsoft WorddocxMicrosoft Word
MyST MarkdownmystMyST Markdown
OpenDocument SpreadsheetodsOpenDocument Spreadsheet
OpenDocument TextodtOpenDocument Text
OXA JSONoxaOXA JSON
PDFpdfPDF
PNGpngPNG
Pandoc ASTpandocPandoc AST
Plain texttextPlain text
PubMed Central OA PackagepmcoaPubMed Central OA Package
Quarto MarkdownqmdQuarto Markdown
R+LaTeXrnwR+LaTeX
Stencila MarkdownsmdStencila Markdown
TSVtsvTSV
TeXtexTeX
YAMLyamlYAML

Deprecated formats directory and swb are not documented.

© 2026 Stencila