Encode a diagram in a URL

You can export your diagram data as a specially formatted URL. When someone clicks on this link, it opens a new copy of the diagram either in the draw.io viewer or editor, depending on the export options you selected.

Note: Your diagram is not stored as a file when exporting to a URL - the data is purely encoded in the link, and that link is always valid. Once you have shared that link with someone, you can’t revoke access, unlike access to a diagram file on a cloud storage platform.

Very large diagrams may not be able to be loaded from a overly long URL as browsers have varying limits on the length of URLs they can load. If you find this happens, use Google Drive to store your diagram - when you publish a diagram publicly from Google Drive, the URL will be shorter and neater.

  1. Select File > Export as > URL.
    Export a diagram as a URL with embedded diagram data
  2. Change the export settings to suit your requirements, then click Create.
    • By default Links will open following the viewer’s browser preferences. Select a different behaviour if you want links to always open in a new tab or a new browser window. If you want, set a different link colour.
    • Deselect All Pages if you only want to include the current page of your diagram.
    • To open your diagram directly in the draw.io editor, deselect the Lightbox checkbox.
    • By default, viewers can edit a copy of the diagram from the draw.io lightbox - change the behaviour or deselect the Edit checkbox.
    • Deselect the Layers checkbox if you don’t want viewers to interact with the layers in your diagram.
      Select the export options to export a diagram to a URL
  3. Copy the URL to share it by email or chat, or click on the Facebook button to add the link to a new post in a new browser tab. Click on Preview to open the link in a new tab. Click Close to return to the diagram editor.
    The address created when you export your diagram as a URL is very long

Learn more about exporting a diagram to a URL