Paste a DBML schema — or a PostgreSQL, MySQL, or SQL Server CREATE TABLE script —
and get two things back: a rendered ER diagram you can download as an SVG, and clean DDL in
whichever dialect you need. Primary keys, foreign keys, NOT NULL and unique
constraints are picked up automatically, and relationship lines connect the actual column rows
rather than just the table boxes.
There is no canvas to drag, no account to create, and no paywall. The diagram is generated
from your text, so it never drifts from the schema and the same input always produces the same
layout. Everything runs locally in your browser — your schema is never uploaded. Working with
SQL elsewhere? Tidy up a query with the SQL Formatter,
understand one with the SQL Explainer, or turn a
spreadsheet into inserts with CSV to SQL.
Frequently asked questions
What is DBML?
DBML (Database Markup Language) is an open-source, plain-text language for describing database schemas. It was created by Holistics, the team behind dbdiagram.io, and is published under the Apache 2.0 license. A schema is written as Table blocks listing columns with settings like [pk], [not null] and [unique], plus Ref lines describing relationships — for example "Ref: posts.user_id > users.id". Because it is just text, a DBML schema lives happily in version control and reviews as a normal diff.
Which SQL dialects can this tool read and write?
It reads DBML, PostgreSQL, MySQL and SQL Server (T-SQL) CREATE TABLE scripts. It writes PostgreSQL, MySQL, SQL Server, Oracle and DBML. That means you can paste MySQL DDL and get Postgres DDL back, or paste DBML and get DDL for any of the four dialects. Parsing and generation are done by Holistics’ @dbml/core library, so the supported syntax matches what dbdiagram.io itself understands — column and table level PRIMARY KEY, FOREIGN KEY, UNIQUE, NOT NULL, DEFAULT and auto-increment forms such as SERIAL, AUTO_INCREMENT and IDENTITY.
Can I drag the tables around or edit the diagram?
No, and that is deliberate. The diagram is generated from your schema text, so the text is the single source of truth — change a column and the diagram updates, with no layout to maintain and nothing to get out of sync. Table positions are computed deterministically: tables are ranked by how often they are referenced and placed in columns so that referenced tables sit to the left of the tables referencing them. The same schema always produces the same diagram, which is what makes the exported SVG safe to commit or drop into a pull request.
What can I do with the exported SVG?
The download is a single self-contained SVG file — no external fonts, stylesheets or images — so it renders anywhere: a README, a wiki, design tools, or a slide deck. It uses explicit colours rather than inheriting a page theme, and because it is vector it stays sharp at any zoom level. Text in the diagram remains real text, so it is searchable and selectable.
Does my schema leave my browser?
No. Parsing, diagram layout, SVG rendering and DDL generation all run locally in your browser with JavaScript. Your schema is never uploaded to a server, there is no signup, and nothing is stored. Closing the tab discards everything.