# ER diagram maker — entities & relationships, no upload

> Free entity-relationship (ER) diagram maker: sketch database entities and relationships with Mermaid ER syntax and render live. Export SVG/PNG/PDF on your device.

Sketch database entities, their attributes, and the relationships between them using Mermaid's ER syntax, and render them live. Export SVG, PNG, or PDF — all on your device.

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.

## How to

1. **Define entities.** List each table/entity with its attributes and keys.
2. **Add relationships.** Connect entities with cardinality (||--o{) and labels.
3. **Refine.** Mark primary and foreign keys and types.
4. **Export.** Download the schema diagram as SVG, PNG, or PDF.

## FAQ

### 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 diagram](https://www.safepaper.app/diagram/class-diagram)
- [Flowchart](https://www.safepaper.app/diagram/flowchart)
- [Playground](https://www.safepaper.app/diagram/playground)
- [Format swap](https://www.safepaper.app/data/csv-to-json)

---

Canonical HTML: https://www.safepaper.app/diagram/er-diagram
Markdown: https://www.safepaper.app/diagram/er-diagram.md

There is no upload endpoint — your files are processed in this browser tab. Open your network tab and check.
