Structure & data
Sketch database entities and relationships with Mermaid ER syntax and render them live. Export SVG/PNG/PDF entirely on your device.
There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check. See how it stays private.
How to create an ER diagram
- Define entities. List each table/entity with its attributes and keys.
- Add relationships. Connect entities with cardinality (||--o{) and labels.
- Refine. Mark primary and foreign keys and types.
- Export. Download the schema diagram as SVG, PNG, or PDF.
Before writing migrations, an ER diagram is where a schema gets sane — entities, attributes, keys, and the cardinality of every relationship. Mermaid's ER syntax lets you draft that as text and see the model take shape immediately.
Keeping the schema diagram as code means it can live in the repo beside the migrations and evolve with them, so the picture of the database matches the database.
For object-oriented structure use the Class diagram, and if you'd rather transform actual data, the Data Desk converts and reshapes CSV/JSON directly.
Frequently asked questions
What is an ER diagram used for?
Designing and documenting a relational database: it shows entities (tables), their attributes, and how they relate with one-to-one, one-to-many, or many-to-many cardinality.
How do I show cardinality?
Mermaid's ER connectors encode it directly — for example ||--o{ means one-to-many — so relationships and their multiplicity are clear at a glance.
Can I document keys and types?
Yes. Each entity block lists its attributes with types and can flag primary and foreign keys, making the diagram a usable schema reference.
Is my schema uploaded to render it?
No. The diagram renders in your browser, so your database design stays private.
Related tools
- Class diagramDescribe classes, fields, methods, and relationships in Mermaid and get a UML class diagram — live preview, local export, no sign-up.
- FlowchartWrite a flowchart in Mermaid text and see it render live, then export SVG, PNG, or PDF — all in your browser, nothing uploaded.
- PlaygroundA free-form canvas for any Mermaid diagram or Graphviz DOT graph. Switch engines, edit live, and export — all on-device, nothing uploaded.
- Format swapCSV, JSON, XLSX