Read and drawn in your browser · Nothing is sent
Code Flowchart Generator
Paste a function, choose its language and press Make the flowchart. Each decision becomes a diamond with yes and no arrows, loops go back to their test, and returns lead to the end. The flowchart is drawn in your browser; change it as text if you like, then download it.
Your code
Its name, such as main. Empty: main, the code outside functions, or the first function.
The flowchart
One arrow or a chain of arrows on each line, with a space on both sides: Order -> Pack -> Ship. Words on an arrow: Paid? -- yes --> Ship. (Start) is a rounded box; a line that ends in ? is a decision. Lines without arrows are steps in order.
How to make a flowchart from code
- Paste or type your code into Your code and choose its Language. For pseudo code, write it like Python:
if,whileandforlines that end with a colon, and the steps under them indented. - If the code has several functions, type the name of the one you want under Function (for example
mainorShop.checkout). Left empty, the page drawsmainif there is one, otherwise the code outside functions, otherwise the first function. - Press Make the flowchart. The message under the button lists the functions it found.
- The flowchart appears in the editor below as Mermaid text. Change the words or the arrows there if you like; the drawing follows as you type.
- Choose Top to bottom or Left to right, then Download SVG (sharp at any size, for Word or slides), Download PNG or Download Mermaid.
How the code becomes a flowchart
- Start and End are rounded boxes; the start box shows the function and its parameters.
- Decisions (
if,else if,elif) are diamonds with yes and no arrows;switch,matchandwhenare one diamond with an arrow for each case. - Loops (
for,while,do … while) are a diamond that the body goes back to;breakleaves the loop,continuegoes back to its test. - Errors:
tryleads to “when an error happens”, which leads to eachcatchorexcept;throwandraisego there too. - Up to three plain statements in a row share one box, so that the chart stays readable. A function defined inside the code is one box; draw it on its own by typing its name.
Limits you should know
- The page reads the structure of the code; it does not run it, compile it or check that it is correct. Unusual syntax (macros,
goto, generators, async details) is drawn as plain boxes. - A
finallyblock is drawn after the normal path and the error path, not after everyreturn. - At most 80 boxes: for long code, draw one function at a time.
- This page draws code as a flowchart; it does not write code from a flowchart.
Where your code goes
Nowhere: the code is read and drawn in your browser. It is kept in this browser as a draft so that you can come back to it (choose another example or clear the box to remove it).