Dynamic Diagram β Share with a Link (No Account Needed)
What is Dynamic Diagram?β
Dynamic Diagram lets you share and open a diagram directly from a link. The link contains your DBML in a safe encoded format, so nothing is saved to an account or server.
- Key benefits: Share quick, stateless diagrams without creating or persisting a diagram in the app.
- Perfect for: Docs, wikis, tickets, chats, and one-off reviews.
How it Worksβ
- You write DBML.
- You encode it and place it into our
dbdiagram.io/embed
link as a?c=
parameter. - Share or embed the link:
- Share directly: Send the link to anyone and they'll see the rendered diagram instantly
- Embed in sites: Add the link to an iframe to display the diagram inline in your docs, wikis, or apps
Quick Startβ
Create the link yourself by encoding your DBML and appending it to /embed?c=
.
Step 1 β Encode your DBMLβ
- The
c
parameter must be: Base64 of your DBML (UTFβ8) and then URL-encoded.
JavaScript (Node.js or browser console):
const dbml = `
Table users {
id int [pk]
name varchar
}
Table orders {
id int [pk]
user_id int [ref: > users.id]
total int
}
`;
// Unicode-safe: UTF-8 β base64 β URL-encode
const base64 = btoa(unescape(encodeURIComponent(dbml)));
const c = encodeURIComponent(base64);
Step 2 β Build the linkβ
https://dbdiagram.io/embed?c=<value of c>
Share the link anywhere: docs, tickets, chat, emails.
Step 3 (Optional) - Embed in your site with an iframeβ
Add the generated link to an iframe to render the diagram inline in your docs, wikis, or apps.
<iframe
src="https://dbdiagram.io/embed?c=ENCODED_DBML"
width="100%"
height="600"
style="border: 0"
loading="lazy"
allowfullscreen
></iframe>
Tips:
- Adjust
height
to fit your content. - Use
width="100%"
for responsive layouts.
Live Exampleβ
The iframe below renders the example DBML from the steps above using an actual encoded c
parameter:
Best Practicesβ
- Keep DBML concise: Very large diagrams may exceed URL length limits in some browsers or tools. We'll try to solve this content length limitation in the future.
- Great for review: Use in PRs, sprint tickets, and doc pages to align quickly.
Privacy & Securityβ
- The DBML is embedded in the URL; anyone with the link can view it.
- Thereβs no server-side persistence for these links.
- Avoid including secrets or sensitive data in DBML if the link could be shared broadly.
Integrationsβ
We also implement packages to help users easier in embed their diagrams:
- Docusaurus: Official plugin available β docusaurus-plugin-dbdiagram.
- More integrations are planned.
Feel free to share your feedback or recommendations for how we may enhance this feature in our community discussion.