If you've ever stared at a blank screen trying to diagram out a process, you know the friction of switching between thinking about logic and writing it. A flowchart syntax cheat sheet for developers solves that problem by giving you a quick-reference set of symbols, rules, and code patterns so you can draft diagrams fast without digging through documentation every time. Whether you're writing pseudocode flowcharts, Mermaid diagrams, or PlantUML charts, having the right syntax at your fingertips saves real time during planning, code reviews, and documentation.
What does flowchart syntax actually look like?
Flowchart syntax is a text-based way to describe shapes, arrows, and decision points using code rather than a drag-and-drop tool. Instead of clicking boxes in a GUI, you write short declarations that define nodes, connections, and flow direction. Tools like Mermaid, PlantUML, and Graphviz DOT each have their own syntax, but the core idea is the same: define elements, then define how they connect.
Here's the basic structure most text-based flowchart languages share:
- Nodes – Represent steps, actions, or states (rectangles, ovals, diamonds)
- Edges – Arrows that show the direction of flow between nodes
- Decision points – Branching logic that splits the path based on a condition
- Start/End terminals – Rounded or oval shapes marking where the process begins and ends
If you're working specifically in Markdown-compatible tools, our guide on how to write flowchart code in Markdown walks through the exact steps to embed flowcharts in your docs.
Which flowchart symbols do developers actually use day to day?
You don't need every symbol from the ISO 5807 standard. Most developers rely on a small subset. Here's the cheat sheet of shapes and what they mean:
- Oval / Rounded rectangle – Start or end of the process
- Rectangle – A process step or action ("Validate input," "Call API")
- Diamond – A decision ("Is the user logged in?") with yes/no branches
- Parallelogram – Input or output ("Read file," "Display result")
- Arrow – Direction of flow between any two elements
- Circle / Connector – Links different parts of the same flowchart
Most text-based syntax tools map directly to these shapes. In Mermaid, for example, a rectangle is [text], a diamond is {text}, and a rounded shape is (text).
How do you write flowchart syntax in Mermaid?
Mermaid is one of the most widely used text-to-diagram tools because it works natively in GitHub, GitLab, and many documentation platforms. The syntax is concise and readable.
A basic Mermaid flowchart looks like this:
flowchart TD
A[Start] --> B{Is input valid?}
B -- Yes --> C[Process data]
B -- No --> D[Show error]
C --> E[End]
D --> E
Key syntax rules to remember:
flowchart TDsets top-down direction (useLRfor left-to-right)- Square brackets
[ ]create rectangles - Curly braces
{ }create diamonds for decisions - Double dashes
-- text -->add labels to connections - Node IDs (like
A,B) are internal references keep them short
For a deeper syntax reference covering all node types and styling options, see our flowchart syntax cheat sheet with full examples.
How does PlantUML flowchart syntax compare?
PlantUML uses a slightly different approach. It relies on activity diagram syntax with keywords like start, stop, if, and endif. Here's a quick comparison:
- Mermaid – Declarative node-and-edge model; great for simple to mid-complexity diagrams
- PlantUML – Imperative keyword-based model; better for complex branching logic and UML integration
- Graphviz DOT – Low-level graph description; powerful but more verbose
A PlantUML activity diagram example:
@startuml
start
:Read input;
if (Valid?) then (yes)
:Process data;
else (no)
:Show error;
endif
stop
@enduml
PlantUML's keyword style reads more like pseudocode, which some developers prefer for algorithm design. Our PlantUML flowchart reference covers the full set of control structures and formatting options.
What are common mistakes when writing flowchart syntax?
Even experienced developers hit these snags regularly:
- Forgetting arrow direction – Without explicit arrows, renderers may draw connections in unexpected orders. Always define direction explicitly.
- Reusing node IDs – In Mermaid, two nodes with the same ID will merge into one. Use unique identifiers.
- Mismatched brackets – A missing closing bracket breaks the entire diagram. Check your syntax before rendering.
- Overly dense diagrams – Cramming 40 nodes into one flowchart makes it unreadable. Split into sub-flows when needed.
- No decision labels – Decision diamonds without yes/no labels confuse readers. Always label branches.
- Ignoring rendering direction – TD vs. LR changes layout significantly. Choose based on your content's natural reading flow.
When should you use a text-based flowchart instead of a visual tool?
Text-based flowchart syntax fits best when:
- You're documenting alongside code – The diagram lives in the same repo as your source files, gets version-controlled, and changes with pull requests.
- You need quick iteration – Editing a few characters is faster than redragging boxes.
- You're writing technical docs or READMEs – Mermaid renders directly in GitHub-flavored Markdown.
- You want diffable diagrams – Text-based diagrams show up in git diffs, so reviewers can see what changed.
For whiteboarding or client-facing presentations, a visual tool like draw.io or Lucidchart still makes more sense. But for developer workflows, text-based syntax wins on speed and maintainability.
How do you pick the right direction for your flowchart?
Most flowchart tools let you set the overall layout direction. This matters more than people realize pick wrong, and your diagram sprawls awkwardly across the page.
- Top-down (TD/TB) – Best for linear processes with a few branches. This is the default and works for most use cases.
- Left-to-right (LR) – Better for comparison flows or when you have many parallel branches. Also reads more naturally on widescreen monitors.
- Bottom-up or Right-to-left – Rarely used. Only choose these if your content specifically demands it.
Quick-reference syntax comparison table
Here's a side-by-side of common flowchart elements across three popular tools:
- Start node – Mermaid:
A([Start])| PlantUML:start| DOT:A [shape=oval] - Process step – Mermaid:
A[Do something]| PlantUML::Do something;| DOT:A [label="Do something"] - Decision – Mermaid:
A{Condition?}| PlantUML:if (Condition?) then| DOT:A [shape=diamond] - Connection – Mermaid:
A --> B| PlantUML: implicit after:| DOT:A -> B - Labeled edge – Mermaid:
A --|Yes| B| PlantUML:if ... then (Yes)| DOT:A -> B [label="Yes"]
Practical checklist before you ship a flowchart
- Confirm every decision diamond has labeled branches (yes/no or specific conditions)
- Check that your diagram has exactly one start and one end point (or clearly marked multiple ends)
- Validate the syntax renders correctly in your target platform before committing
- Keep node text under 6–8 words for readability
- Use subgraphs or separate diagrams if the flow exceeds 15–20 nodes
- Review the rendered diagram at the size your readers will actually see it
- Add a short caption or title above the flowchart for context
Start by picking one tool Mermaid is the lowest barrier to entry if you're already using GitHub draft a flowchart for a real feature or bug fix you're working on this week, and commit it alongside your code. You'll get faster with every diagram.
Flowchart Code Syntax: a Beginner's Guide
Mermaid Flowchart Syntax Examples and Usage
Plantuml Flowchart Diagram Code Syntax Reference Guide
How to Write Flowchart Code in Markdown Syntax
Plantuml Sequence Diagram Syntax and Notation Reference Guide
Uml Sequence Diagram Combined Fragment Examples and Notation Guide