How to use
- schema.sql3 tables
Add CREATE TABLE statements
- ER diagramlines between tables
Link tables by foreign keys
- definitions.xlsxalso SVG, PNG, Mermaid
Export the definition document
Press “Try the sample”, or paste CREATE TABLE statements into the box. You can also drop files (.sql, .txt, .db).
Leave the dialect on Auto-detect; most input reads fine. If something is missed, pick MySQL, PostgreSQL or another dialect.
On the ER diagram tab, check the relation lines. Drag a table to move it, or use the arrow keys.
Check the columns on the Table definitions tab, and the lines that could not be read (with line numbers) on the Parse results tab.
Under Export, save the diagram as SVG, PNG (scale ×1 to ×3) or Mermaid (.mmd), and the definitions as HTML, Markdown, CSV or Excel (one sheet per table).
What it does
ER diagram with foreign-key lines
Reads foreign keys written inline, as table constraints, or with ALTER TABLE ADD CONSTRAINT. Relation lines show one-to-many or one-to-one, and whether the parent side is required or optional.
Comments as logical names
Reads column and table comments from MySQL COMMENT clauses, PostgreSQL COMMENT ON, and SQL Server sp_addextendedproperty descriptions, and uses them in the headings and the column descriptions.
Five dialects
Reads the common CREATE TABLE, CREATE INDEX and ALTER TABLE syntax of MySQL, MariaDB, PostgreSQL, SQLite, SQL Server ([brackets] and GO separators) and Oracle. Works without choosing a dialect; [bracket] names are read as SQL Server syntax.
Unreadable statements listed by line
Statements that cannot be read, and tables that point at a table not in the input, are listed with their line and the reason. Everything read still becomes a diagram and definitions. An unclosed quote or comment stops reading at its line, and that line is listed.
Excel cells are never formulas
In the Excel and CSV exports, a value that starts with =, + or - gets a leading apostrophe, so spreadsheet apps show it as text instead of running it.
Use cases
- Make an ER diagram for a design document from existing DDL quickly
- Skip building a table definition spreadsheet by hand: type, NULL, default and comment per column
- Document the structure of a SQLite .db file for a handover
- Turn DDL into Mermaid code to paste an ER diagram into GitHub or Notion
- Draw a confidential schema without sending it to an outside service
Supported formats
Input
Output
Capability matrix
| Feature | Support | Notes |
|---|---|---|
| Reading CREATE TABLE, CREATE INDEX, ALTER TABLE ADD (foreign, primary and unique keys) and COMMENT | Supported | — |
| Automatic diagram placement, dragging, SVG, PNG and Mermaid export | Supported | — |
| Table definition export as HTML, Markdown, CSV and Excel | Supported | — |
| Connecting to a live database | Not supported | No connection is made. Only the definitions (DDL text or the structure of a .db file) are read |
| Analysing stored procedures, views, triggers and functions | Not supported | They are left in the parse results. View columns are not guessed |
| Applying ALTER TABLE changes other than ADD (DROP, MODIFY, RENAME, ALTER COLUMN and so on) | Partial | Only ADD (columns, constraints, foreign keys) is applied. Other changes stay in the parse results |
| Reading data (the contents of INSERT statements) | Not supported | Only table definitions are handled |
Limits & notes
- Input is limited to 3 million characters in total and 200 tables.
- A .db file is limited to 50 MB. Encrypted databases cannot be opened.
- Relation lines are drawn only when the referenced table is in the same input.
- The dialect is detected from the text. Where the same syntax means different things in two dialects, choose the dialect yourself.
- SVG and PNG text is drawn with the fonts on your device. PNG is limited to 8,192 px on the longest side and 32 million pixels.
Privacy & safety
Reading the SQL, drawing the diagram and exporting all happen in your browser. Neither files nor DDL are sent to or stored on a server. SQLite files are read in the browser too.
FAQ
How do I make an ER diagram from CREATE TABLE statements?
Can I export the table definitions to Excel?
What happens to statements that cannot be read?
Are MySQL COMMENT clauses and PostgreSQL COMMENT ON used?
Can it connect to a database and read it?
Is it safe to paste an internal schema?
Related tools
SQL Studio — Format, Analyze & Convert
Paste SQL to format, minify or analyze it for your dialect. Strings and comments are never altered, UPDATE/DELETE without WHERE and DROP are flagged, and value lists or CSV rows become IN clauses and INSERT statements — all on your device.
SQLite Viewer & Query Playground
Drop a .sqlite or .db file to list its tables, views, indexes and triggers and browse rows with paging, sorting and filtering. Run multi-statement SQL in the editor, export results as CSV, Excel or JSON, and save the changed database as .sqlite. Your files never leave your device.
Mermaid Studio
Write Mermaid code on the left and the diagram appears on the right. Start from a flowchart, sequence, class or ER template and save SVG or PNG with the scale and background you choose. Rendering happens in your browser; your code is never sent.
Dummy Data Generator
Build fictional test data for demos and development. Pick a type per column and export to CSV, TSV, JSON, JSON Lines, SQL INSERT or Excel. Names, addresses and companies are made-up combinations, and emails use only example domains.
CSV Encoding Fix
Convert CSV files that show garbled text in Excel to UTF-8 with BOM or Shift_JIS, with automatic encoding detection. Mojibake that was already saved, such as “日本語”, can usually be restored too.
CSV Studio
Open CSV files that are slow or garbled in Excel and view, search and edit them right away in your browser. Combine, split and save as CSV (UTF-8 with BOM, Shift_JIS), Excel or JSON on one screen.
Last updated: