Introduction
A DRAWIO file is a diagram saved by draw.io (also known as diagrams.net), the free diagram editor from JGraph that runs in a web browser and as a desktop app. It holds flowcharts, network diagrams, UML, org charts and similar drawings made of shapes joined by connectors.
The same diagram data can also be embedded in a PNG or SVG export, so the image can be opened and edited again in draw.io.
Structure
A DRAWIO file is XML. The root element is mxfile, with one
diagram element per page. Each page holds an mxGraphModel
whose root lists mxCell elements: every shape and connector
is a cell with an id, a parent, a style string and, for shapes, an
mxGeometry giving its position and size. Connectors name their source and
target cells.
Older files, and files saved with compression turned on, store each page's model as
deflate-compressed, Base64-encoded text inside the diagram element
instead of plain XML.
<mxfile>
<diagram name="Page-1" id="…">
<mxGraphModel>
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<mxCell id="2" value="Start" style="rounded=1;" vertex="1" parent="1">
<mxGeometry x="40" y="40" width="120" height="60" as="geometry"/>
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
Every element, attribute and style key, the compression steps and how diagrams are kept inside PNG and SVG files are on the XML and styles reference page.
Not described
The XML page follows draw.io’s own documentation and the jgraph mxgraph, drawio and drawio-mcp sources.
Known, not yet covered
- Reference: the stencil shapes (
mxgraph.*) are a large library and are not listed, and their per-shape style keys are not described. - Viewer: there is no draw.io plugin yet.
Unknown
- Reference: the version in which draw.io changed to writing uncompressed pages by default: no source states the date.
- Reference: whether a
compressedattribute onmxfilemeans anything: the current source neither writes nor reads it (see the XML page).
Links
Software
- draw.io – free diagram editor that makes DRAWIO files (web browser, Windows, macOS, Linux)
Developers
- jgraph/drawio – the editor’s source code (JavaScript)
Reference
- Diagram generation – JGraph’s description of the file’s XML, compression and styles