Org charts from an AI reply: companies and project teams

The prompt that gets org chart Mermaid code from an AI assistant, how to write reporting lines and dotted-line reports, listing several reports on one line, names and titles on two lines, and layout and export when there are many departments.

About 3 minUpdated 2026-11-11

The prompt

Draw a company org chart with Mermaid flowchart TD syntax. Under the CEO there are four departments: Engineering, Marketing, Finance and HR. Engineering has Frontend, Backend and QA teams; Marketing has Brand and Sales teams. Connect manager to report with -->, and put several reports of one manager on one line with &. Use short letter ids with the display name in square brackets. Give the complete mermaid code block.

A typical result

flowchart TD
    CEO[CEO] --> ENG[Engineering] & MKT[Marketing] & FIN[Finance] & HR[HR]
    ENG --> FE[Frontend] & BE[Backend] & QA[QA]
    MKT --> BRAND[Brand] & SALES[Sales]

Edit the text, switch themes and download PNG, Word or PowerPoint from there.

Syntax notes

  • One link per reporting line: A --> B means B reports to A.
  • Several reports on one line: A --> B & C & D is shorter than three lines and harder to get wrong.
  • Dotted-line reporting: PM -.-> FE, for a project manager guiding several teams.
  • Name plus title: CTO["Ana Ruiz<br/>CTO"]; <br/> breaks the line, and text with a tag needs double quotes.
  • Box a division: subgraph East region … end.

Too many departments, chart too wide

Change the first line to flowchart LR so levels run left to right, or switch the direction and spacing under Layout in the editor. If it is still large, split it: top-level departments in the overview and one chart per department.

Edit and export

In the editor preview, double-click a node to rename it and click a node, then Add a branch, to add a report without hunting through the code. Export to Word for a handbook or to PowerPoint for a company deck. The org chart templates have three ready-made hierarchies.

More guides

All guides