Database Schema Visualizer
Paste SQL CREATE TABLE statements and instantly see a live entity-relationship diagram - tables rendered as cards with typed columns and PK / FK / UNIQUE / NOT NULL markers, plus every foreign key drawn out as a relationship. The robust DDL parser handles multiple statements across PostgreSQL, MySQL, and SQLite, including inline and table-level constraints. Export the schema to a Mermaid erDiagram, PlantUML, DBML, ASCII table, or a JSON dump - all updating live as you type, all in your browser.
About this ToolHow it works, benefits & use casesTap to collapse
Paste your SQL CREATE TABLE statements and instantly see a live entity-relationship diagram. A robust DDL parser scans every CREATE TABLE block - across PostgreSQL, MySQL, and SQLite syntax - reading each column with its type and inspecting both inline and table-level constraints: it marks PRIMARY KEY columns, tracks NOT NULL nullability, flags UNIQUE columns, captures DEFAULT values, and turns FOREIGN KEY ... REFERENCES clauses (and inline column REFERENCES shorthand) into relationships between tables. The page renders the result as a diagram of entity cards - one per table, each listing its columns with type and PK / FK / UNIQUE / NOT NULL badges - alongside a summary strip (table, column, relationship, and foreign-key counts) and a drawn-out list of every relationship with its inferred cardinality. From the same parsed model you can export to five formats: a Mermaid erDiagram you can paste into mermaid.live, PlantUML, a DBML schema for dbdiagram.io, a plain ASCII table, or a JSON dump of the parsed schema. Everything updates live as you type and runs entirely in your browser, and the schema plus chosen format are captured in a shareable URL.
How to Use
- 1Paste your CREATE TABLE statements into the SQL schema box, or click "Load example" for a users/posts/comments sample with foreign keys.
- 2Watch the live ER diagram, summary counts, and relationship list update as you type - no run button needed.
- 3Pick an export format: Mermaid ER diagram, PlantUML, DBML, ASCII table, or JSON schema.
- 4For Mermaid, copy the output and paste it into mermaid.live (linked from the hint) to render the chart interactively.
- 5Copy, download, share the URL, or pipe the output to another tool.
Key Benefits
- Live, in-page ER diagram - tables as cards with typed columns and PK / FK / UNIQUE / NOT NULL markers
- Robust parser for multiple CREATE TABLE statements across PostgreSQL, MySQL, and SQLite
- Reads inline and table-level PRIMARY KEY, FOREIGN KEY, UNIQUE, REFERENCES, and DEFAULT
- Foreign keys drawn out as relationships with inferred one-to-one / one-to-many cardinality
- Summary strip with table, column, relationship, and foreign-key counts
- Five exports from one paste: Mermaid, PlantUML, DBML, ASCII, and JSON schema
- Everything is live and runs in your browser, with a fully shareable URL
Common Use Cases
- Understanding an unfamiliar database from its CREATE TABLE dump at a glance
- Generating a Mermaid or PlantUML ER diagram to embed in docs or a pull request
- Converting an existing SQL schema into DBML to edit it in dbdiagram.io
- Producing an ASCII schema summary for a README, terminal, or code comment
- Reviewing foreign-key relationships across a set of tables before a migration
- idSERIALPK
- usernameVARCHAR(50)UQNN
- emailVARCHAR(255)UQNN
- created_atTIMESTAMP
- idSERIALPK
- author_idINTEGERFKNN
- titleVARCHAR(200)NN
- bodyTEXT
- publishedBOOLEAN
- created_atTIMESTAMP
- idSERIALPK
- post_idINTEGERFKNN
- author_idINTEGERFKNN
- bodyTEXTNN
- created_atTIMESTAMP
- posts.author_idusers.idone-to-many
- comments.post_idposts.idone-to-many
- comments.author_idusers.idone-to-many
Paste this into mermaid.live to render it interactively.
Copy, download, share, or pipe to another tool
erDiagram
users {
SERIAL id PK NOT NULL
VARCHAR(50) username NOT NULL
VARCHAR(255) email NOT NULL
TIMESTAMP created_at
}
posts {
SERIAL id PK NOT NULL
INTEGER author_id FK NOT NULL
VARCHAR(200) title NOT NULL
TEXT body
BOOLEAN published
TIMESTAMP created_at
}
comments {
SERIAL id PK NOT NULL
INTEGER post_id FK NOT NULL
INTEGER author_id FK NOT NULL
TEXT body NOT NULL
TIMESTAMP created_at
}
posts ||--o{ users : "references"
comments ||--o{ posts : "references"
comments ||--o{ users : "references"
644 characters - paste CREATE TABLE statements
Live, no button needed
The diagram, summary, and export all recompute as you type. Tables become entity cards with typed columns and PK / FK / UQ / NN markers, and every foreign key is drawn as a relationship.
Robust DDL parsing
Handles multiple CREATE TABLE statements, quoted identifiers, inline and table-level PRIMARY KEY / FOREIGN KEY / UNIQUE, and REFERENCES across PostgreSQL, MySQL, and SQLite.
Was this tool helpful?
Share Your Experience
Help others discover this tool!
Related tools
- SQL FormatterFormat and beautify SQL queries
- GraphQL Schema ValidatorValidate GraphQL schema definitions
- CSV to SQL ConverterTurn CSV into CREATE TABLE + INSERT statements with delimiter auto-detect, per-column type inference, and dialect-aware output for PostgreSQL, MySQL, SQLite, or SQL Server
- MongoDB Query BuilderVisually build MongoDB find queries and aggregation pipelines, then export to the Mongo shell, Node.js driver, Mongoose, or pymongo
- SQL to NoSQL ConverterConvert SQL SELECT/INSERT/UPDATE/DELETE to MongoDB find queries or aggregation pipelines, with output for the Mongo shell, Node.js driver, or Mongoose and a clause-by-clause mapping
- PostgreSQL vs MySQL ComparisonSearch and filter a side-by-side PostgreSQL vs MySQL syntax reference by topic, plus a two-way query converter and a when-to-choose-which summary
It scans CREATE TABLE name (...) blocks - including TEMPORARY tables and IF NOT EXISTS - and reads each column name, type (keeping length/precision like VARCHAR(255) or DECIMAL(12,2)), and inline constraints. It flags PRIMARY KEY, treats NOT NULL as non-nullable, marks UNIQUE columns, captures DEFAULT values, and reads both inline column REFERENCES and table-level FOREIGN KEY (col) REFERENCES table(col) clauses. Quoted identifiers (double quotes, backticks, brackets) and SQL line and block comments are handled, and commas inside type definitions like DECIMAL(12, 2) are not mistaken for column separators.
It draws a real diagram in the page. Each table renders as an entity card listing its columns with type and PK / FK / UNIQUE / NOT NULL badges, a summary strip shows the counts, and every foreign key is rendered as a relationship line with its inferred cardinality. Separately, you can also export Mermaid or PlantUML code if you want to render a richer chart elsewhere (for example by pasting Mermaid into mermaid.live).

