consolelog.tools

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 cases

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

  1. 1Paste your CREATE TABLE statements into the SQL schema box, or click "Load example" for a users/posts/comments sample with foreign keys.
  2. 2Watch the live ER diagram, summary counts, and relationship list update as you type - no run button needed.
  3. 3Pick an export format: Mermaid ER diagram, PlantUML, DBML, ASCII table, or JSON schema.
  4. 4For Mermaid, copy the output and paste it into mermaid.live (linked from the hint) to render the chart interactively.
  5. 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
ER Diagramlive preview
3tables
15columns
3relations
3FKs
users4 cols
  • idSERIALPK
  • usernameVARCHAR(50)UQNN
  • emailVARCHAR(255)UQNN
  • created_atTIMESTAMP
posts6 cols
  • idSERIALPK
  • author_idINTEGERFKNN
  • titleVARCHAR(200)NN
  • bodyTEXT
  • publishedBOOLEAN
  • created_atTIMESTAMP
comments5 cols
  • idSERIALPK
  • post_idINTEGERFKNN
  • author_idINTEGERFKNN
  • bodyTEXTNN
  • created_atTIMESTAMP
Relationships
  • 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