Yirinhana Tools

简体中文 · English · Español · Português · 日本語 · Deutsch

ER diagram maker

ER diagram maker. Model tables, keys and relationships. Export diagrams and Mermaid text. Your files stay on this device. Processing happens in your browser.

Enable JavaScript to use the tools. Files are processed in your browser.

Describe tables before writing database code

An entity relationship diagram makes the structure of a small database easier to discuss. Load the User, Order and OrderItem example, then rename the entities to match your project. Select an entity to edit its title and fields. Each field has a name, a plain text type and optional primary, foreign or unique key flags. Use a single word for names and types, with underscores where needed; values such as user_id, varchar(120) and datetime are supported. Apply your changes before moving to another entity. These labels describe your design: the editor does not connect to a database, inspect records, execute SQL or verify that a foreign key matches a real column.

Make cardinality and optionality explicit

Create a relationship by selecting two entities and choosing 1:1, 1:N, N:1 or N:M. Add a verb such as places or contains so another reader can understand its purpose. Optional endpoint controls distinguish a relationship that may have no related record. Solid and dashed lines can express identifying and non-identifying relationships. The exported SVG uses readable cardinality labels rather than decorative lines without meaning. Mermaid erDiagram import supports entity blocks, aliases, fields, PK/FK/UK constraints and the displayed relationship forms. Unsupported statements stop the import and preserve your current diagram. Downloading the Mermaid source also preserves node positions in an ordinary comment so that importing it into this editor restores the arrangement.

Keep an editable copy as well as an image

The editor runs in your browser. Diagram content is not sent to a conversion server, and no account is required. Changes are saved in localStorage for this browser and this tool. That is convenient for returning to a draft, but it is not a backup: private browsing, clearing site data, or changing devices can remove access to it. Download the Mermaid file whenever you reach a useful milestone. It contains the diagram structure and a comment with the current node positions. SVG is useful for documents and high resolution printing; PNG is useful for slides and messages. Both contain the diagram itself, without editor controls. Before sharing, open the exported file and check that all labels are readable. Very large PNG exports are rejected with a visible error; move nodes closer together or choose SVG. The ZIP bundle collects a matching PNG, SVG, Mermaid file and JSON model in one download. Use the Mermaid contents when importing back into this editor.

Frequently asked questions

Can one field be both a primary and a foreign key?

Yes. Enable PK and FK on the same field. The Mermaid export writes both constraints. UK is available for a unique key as well. These are design annotations, not an automatic database migration.

Can I roundtrip a diagram from another Mermaid editor?

Simple erDiagram text using the supported subset can be imported and edited. Complex directives, styling and unsupported syntax are rejected explicitly. Review the result and keep the original source if your database model contains features outside this subset.

Related tools