How-to guide

How to make a flowchart with ChatGPT

Chat assistants such as ChatGPT are good at describing a process, but a chat reply is text. To get a flowchart you either ask for the reply in a diagram language and render it, or use a tool that returns the diagram itself.

Method 1: ask for Mermaid code, then render it

Mermaid is a text syntax for diagrams. ChatGPT and other assistants can write it, and many tools render it.

  1. Describe the process and ask for Mermaid. Name the steps, who does them and every decision. A prompt like the one below works well.
  2. Copy the code block. The reply should start with flowchart TD (top-down) or flowchart LR (left-right).
  3. Render it. Paste the code into a Mermaid renderer such as the Mermaid Live Editor, a Mermaid code block in a Markdown file on GitHub, or a Mermaid extension for VS Code.
  4. Fix errors. If the renderer reports a syntax error, paste the error back into the chat and ask for a corrected version. Labels containing brackets or quotes are a common cause; wrap them in double quotes.
  5. Change it. Edit the code yourself or ask for a new version. Each change regenerates the whole layout.
Write Mermaid flowchart code (flowchart TD) for our expense approval process.
Employee submits an expense with a receipt. If it is over $500, a manager reviews it first;
otherwise finance reviews it directly. Rejected expenses go back to the employee with a reason.
Approved expenses are paid in the next payroll run.
Use diamonds for decisions and label every arrow that leaves a decision.

The kind of code to expect (written for this page as an example, not copied from a chat):

Mermaid source for this diagram
flowchart TD
  s(["Employee submits expense with receipt"])
  d1{"Over $500?"}
  mgr["Manager reviews"]
  d2{"Manager approves?"}
  fin["Finance reviews"]
  d3{"Finance approves?"}
  back(["Returned to employee with reason"])
  pay["Pay in next payroll run"]
  e(["Expense closed"])
  s --> d1
  d1 -->|Yes| mgr
  d1 -->|No| fin
  mgr --> d2
  d2 -->|Yes| fin
  d2 -->|No| back
  fin --> d3
  d3 -->|Yes| pay
  d3 -->|No| back
  pay --> e

Paste into any Markdown tool that renders Mermaid, such as GitHub.

And the flowchart that code describes:

Expense approval flowchart rendered from Mermaid codeYesNoYesNoYesNoEmployee submits expensewith receiptOver $500?Manager reviewsManager approves?Finance reviewsFinance approves?Returned to employeewith reasonPay in next payroll runExpense closed
Expense approval flowchart rendered from Mermaid code

Method 2: PlantUML or Graphviz DOT

The same pattern works with other diagram languages. Ask for PlantUML (common for sequence and activity diagrams) or Graphviz DOT (general graphs), then paste the result into a matching renderer, such as PlantText or WebGraphviz, or a VS Code extension. The trade-offs are the same as with Mermaid: you get a layout chosen by the renderer and you edit the diagram by editing code.

Method 3: generate an editable diagram directly

If you do not want to handle code, paste the same description into a diagram generator. flow-chart.io returns a laid-out flowchart where every shape is an object you can click, rename or move, and you can refine it by describing changes. Pro can still export Mermaid if your documentation needs it.

Replace the example with your own steps. The free preview (no sign-up) drafts up to 8 main steps; add branches and the remaining steps in the editor.

Which method fits?

MethodGood forWatch out for
Mermaid from ChatGPTDiagrams kept in Markdown, wikis and repositoriesSyntax errors; limited control over layout; every edit is a code edit
PlantUML or DOT from ChatGPTSequence diagrams and general graphs for developersNeeds a separate renderer; same editing trade-offs
An image generated in the chatA quick illustrationAn image is pixels: you cannot move one box or fix one label without making a new image, and generated text can be misspelled
A diagram generator such as flow-chart.ioProcess documentation for people who do not write codeReview the draft; free plan limits apply (one standard diagram a month)

Prompt tips for better flowcharts

Frequently asked questions

Can ChatGPT make a flowchart?
It can write diagram code such as Mermaid, which a renderer turns into a flowchart, and it can generate images. A generated image is a picture rather than an editable diagram, so diagram code or a diagram tool is the better route when you will need to change the flowchart later.
Why does my Mermaid flowchart show a syntax error?
Common causes are special characters in labels (brackets, quotes, parentheses) and node IDs that clash. Wrap labels in double quotes, keep IDs short and unique, and paste the exact error back into the chat.
Is there a free way to render ChatGPT's Mermaid code?
Yes. The Mermaid Live Editor is free, and GitHub renders Mermaid code blocks in Markdown files.
Can I import ChatGPT's Mermaid code into flow-chart.io?
flow-chart.io does not import Mermaid one-to-one. Paste the plain-language description instead and generate an editable version; Pro can export it back to Mermaid.

Source: Rendering options for LLM-written diagram code are summarised in KDnuggets' guide to making flowcharts with LLMs (www.kdnuggets.com/3-easy-ways-create-flowcharts-diagrams-using-llms). Plans and features change; check the vendor's page before deciding.

Related

Text to flowchartMermaid alternativeMermaid limitationsFlowchart symbolsExpense reimbursement flowchartAI diagram generator

Last reviewed 9 November 2026.

Describe it. Get an editable diagram.

Free to build and edit; Flow Pro adds downloads and unlimited diagrams.

Start free See pricing