Export your diagram to an XML file

By default, draw.io saves your diagrams as an XML file with the .drawio file extension. This is so that your operating system knows to open this file in draw.io if you are using our desktop app, or the unofficial draw.io extension for VSCode.

To save your diagram instead with the .xml file extension instead and the initial XML version tag (<?xml version="1.0" encoding="UTF-8"?>), you need to export the file.

  1. Select File > Export as > XML.
    Export a diagram as an XML file
  2. Change the export settings to suit your requirements, then click Export.
    • Click the Selection Only checkbox to create an XML file with just the selected elements of your diagram. This option is disabled if nothing is selected.
    • Deselect the Compressed checkbox to save an uncompressed version of the XML file. You can also use our online tool to decompress .xml and .drawio diagram files created in draw.io.
    • Deselect the All Pages checkbox to only export the current diagram page to the XML file.
      Choose the export settings when exporting a diagram as an XML file
  3. Enter a Filename, and select the location where you want to save the exported XML file, or click Download.
    Choose where to save your exported XML file

Depending on your browser, you may be prompted to open it with a default program, or simply save the file.