Home › SQL to DBML
SQL to DBML
Paste your SQL CREATE TABLE statements and export them as DBML — ready for dbdiagram.io and other DBML tools — while you preview the live ER diagram.
No signup · nothing uploaded · export PNG / SVG / Mermaid / DBML · shareable link
How it works
- Paste your SQL schema into the editor (PostgreSQL, MySQL, SQLite, SQL Server, Oracle…).
- The diagram renders instantly so you can confirm the tables and relations.
- Click Export → DBML and copy the result.
- Paste it into dbdiagram.io or any DBML-based workflow.
Example
This SQL:
CREATE TABLE users ( id SERIAL PRIMARY KEY, email TEXT UNIQUE ); CREATE TABLE posts ( id SERIAL PRIMARY KEY, user_id INT REFERENCES users(id) );
…exports as this DBML:
Table users {
id serial [pk]
email text [unique]
}
Table posts {
id serial [pk]
user_id int
}
Ref: posts.user_id > users.id
Copy it from Export → DBML. Try it with your own →
Why use it
- Private: everything runs in your browser — nothing is uploaded or stored on a server.
- dbdiagram.io-ready DBML output.
- Verify visually — see the live diagram before you copy.
- Free & open source — no account, no sign-up.
SQL → DBMLSQL → MermaidSQL → PlantUMLPNG / SVG
FAQ
How do I convert SQL to DBML?
Paste your CREATE TABLE statements, then click Export → DBML and copy the output. Tables become Table blocks and foreign keys become Ref: lines.
Is this a free dbdiagram importer?
Yes — convert SQL to DBML for free and paste it straight into dbdiagram.io, with no account.
Is my schema uploaded anywhere?
No. Everything runs locally in your browser — your schema is never uploaded to or stored on any server.
Is it free?
Yes. It is completely free and open source, with no account or sign-up required.