Visualizers

Mermaid Flowchart Editor

Draw flowcharts from text. Start from the example, check the syntax below, or paste code and let AI turn it into a flowchart.

  • Runs in your browser
  • Instant results
  • Free, no sign-up
Loading the tool…

How to use the Mermaid Live Editor

  1. Edit the example or paste your own flowchart. Use TD (top-down) or LR (left to right) on the first line.
  2. Add nodes like A[Box], B{Decision} and C((Circle)), and join them with --> or -->|label|.
  3. Download SVG or PNG, copy the Markdown block for GitHub, or copy a share link.

Frequently asked questions

How do I make a flowchart in Mermaid?

Start with "flowchart TD", then write one connection per line, for example "A[Start] --> B{Is it valid?}" and "B -->|Yes| C[Save]". Each node gets an id (A, B, C) the first time it appears with its shape and label; after that you can use the id alone.

Can AI turn my code into a flowchart?

Yes. Paste Python, Java, C++, JavaScript or other code in the "Code to flowchart" box and AI writes a Mermaid flowchart of its steps, decisions and loops. In our online code editors the Flowchart button does the same for the code you are running.

What is the difference between graph and flowchart?

"graph" is the older keyword and "flowchart" the newer one. Both draw the same diagrams, but only "flowchart" supports the newer arrow types and features, so prefer it.

How do I put a flowchart in a GitHub README?

Copy the Markdown block (a ```mermaid code block) and paste it into any Markdown file. GitHub, GitLab and many wikis draw it as a diagram.

Syntax cheat sheet

CodeWhat it does
flowchart TDStart a flowchart, top to bottom (LR, RL and BT also work)
A[Text]A box (rectangle) with an id and a label
B{Question?}A decision (diamond)
C([Start]) D((End))A rounded "stadium" shape and a circle
A --> BAn arrow from A to B
A -->|Yes| BAn arrow with a label
A -.-> B A ==> BA dotted arrow and a thick arrow
subgraph Name ... endA group of nodes in a box
%% commentA comment, not drawn

Practice Python with coding challenges

Solve hands-on problems right in this editor: run the sample tests, submit, and get an AI code review.

All Python challenges
Easy

Rectangle Perimeter

Compute the perimeter of a rectangle from its sides.

You'll learn ArithmeticReturn values
BeginnerLearning-pathVariables
Easy

Distance Between Points

Compute the straight-line distance between two points.

You'll learn Pythagorean theoremSquare roots
BeginnerFunctionsLearning-pathmath
Easy

Average of Three

Average three whole numbers.

You'll learn ArithmeticDivision
BeginnerLearning-pathVariables
Easy

Prime Number Check

Decide whether a number is prime.

You'll learn DivisibilityLoop optimization
BeginnerLoopsNumbersStudent-beginner
Easy

Dot Product of Two Vectors

Multiply two vectors element by element and add the results: the core operation of every neuron.

You'll learn VectorsDot product
Neural networksaimachine learning
Easy

Days in a Month

Return how many days a month has, including leap years.

You'll learn Calendar rulesHelper functions
BeginnerConditionsFunctionsLearning-path
Easy

Count Uppercase Letters

Count the capital letters in a text.

You'll learn Character checksCounting
BeginnerLearning-pathStrings
Easy

Celsius to Fahrenheit

Convert a temperature from Celsius to Fahrenheit.

You'll learn FormulasOperator precedence
BeginnerLearning-pathVariables
Easy

Min and Max Together

Find the smallest and largest value in one pass.

You'll learn Single passMultiple return values
ArraysBeginnerFunctionsLearning-path
Easy

Largest of Three

Pick the largest of three numbers without a built-in max.

You'll learn ComparisonsCombining conditions
BeginnerConditionsLearning-path
Easy

Swap First and Last

Exchange the first and last items of a list.

You'll learn List indexingSwapping
ArraysBeginnerLearning-path
Easy

Password Rules Check

Check a password against simple strength rules.

You'll learn ValidationBoolean flags
BeginnerConditionsLearning-pathStrings