Turn code or a plain-English algorithm description into a flowchart of its steps, decision branches, and loops, rendered as Mermaid syntax or an ASCII diagram.
You are an instructor who has noticed that some students can read a paragraph description of an algorithm's logic just fine, while others only really see the shape of it once the branches and loops are laid out visually, as boxes and arrows and diamonds, and a flowchart exists specifically to serve that second kind of understanding. My output format is [FORMAT:select:Mermaid flowchart syntax,plain ASCII text diagram]. My input, either actual code or a plain-English description of an algorithm's steps, is: [INPUT] If I left [INPUT] blank, ask me to provide either code or a description before doing anything else instead of inventing an algorithm to diagram. Identify the actual control flow structure in [INPUT], the sequential steps that always run in order, every decision point where the logic branches based on a condition, and every loop where a group of steps repeats until some condition is met. Represent sequential steps as ordinary process boxes, decision points as diamond shapes with the actual condition written inside and both possible outcomes labeled clearly, such as yes and no or true and false, and loops as a cycle that returns to an earlier point in the diagram rather than as another straight-through path, since collapsing a loop into a single box would hide the exact thing a flowchart is supposed to make visible. If I chose Mermaid flowchart syntax, produce valid `flowchart TD` code using the correct Mermaid node shapes, square brackets for a process box and curly braces for a decision diamond, and correct arrow syntax including the yes and no labels on the branches coming out of each decision, so the code can be pasted directly into a Mermaid live editor or any markdown renderer that supports Mermaid diagrams, such as GitHub's own markdown rendering, without needing any manual fixes. If I chose plain ASCII text diagram, build the diagram using boxes drawn with characters like plus signs, dashes, and vertical bars, and arrows drawn with characters like `-->` or `|`, arranged so the flow reads top to bottom or left to right in a way that stays legible in a monospaced font, such as inside a terminal or a plain text file, and keep box widths consistent enough that the diagram does not visually collapse when viewed at a normal terminal width. Close by stating in one sentence how many decision points and how many loops the diagram contains, since that count is a quick, concrete way to gauge how complex the underlying logic actually is compared to how long the original code or description looked.
Use this prompt anywhere
10,000+ expert prompts for ChatGPT, Claude, Gemini, and wherever you use AI.
Get Early AccessSome people read a paragraph describing an algorithm's logic and follow it fine. Others only see the shape of it once branches and loops are laid out as boxes, arrows, and diamonds, and a flowchart serves that second kind of understanding, one a wall of code or prose can't reach alone.
This tool takes [INPUT], either actual code or a plain-English description, and identifies its real control flow, the steps that always run in order, every point where logic branches on a condition, and every loop that repeats until something changes. Sequential steps become process boxes, decisions become diamonds with the condition written inside and both outcomes labeled, and loops get represented as a genuine cycle back to an earlier point, never collapsed into a single box, since that would hide the thing a flowchart is supposed to reveal.
Set [FORMAT] to Mermaid flowchart syntax for valid flowchart TD code using correct node shapes and labeled branches, ready to paste into a Mermaid live editor or any markdown renderer that supports it, including GitHub's, with no manual fixes needed. Or choose a plain ASCII text diagram built from dashes, bars, and arrows, legible in a monospaced font like a terminal. Every diagram closes with a count of its decision points and loops, a quick gauge of complexity. Run it in the Dock Editor for a library of diagrams, pair with the algorithm explainer for the analogy first, or the pseudocode to code converter to turn it back into working code.
Paste actual code or describe an algorithm's steps in plain English into [INPUT]. Leaving it blank prompts a request for real input instead of an invented example.
Set [FORMAT] to Mermaid flowchart syntax for a renderable diagram, or plain ASCII text diagram for something readable directly in a terminal or text file.
Steps that always run in order become straightforward process boxes in the flowchart.
Every point where logic branches on a condition becomes a diamond with the actual condition written inside and both outcomes clearly labeled.
Repeating logic is drawn as a genuine cycle back to an earlier point in the diagram, since collapsing a loop into one box would hide the thing worth seeing.
Turn a confusing paragraph description or a snippet of code into a visual flowchart, seeing the branches and loops laid out instead of reading them as prose.
Generate Mermaid flowchart code for an algorithm you need to include in a report or presentation, ready to paste into a renderer without manual cleanup.
Turn a function with several conditions and a loop into a visual diagram, useful both for your own understanding and for explaining the logic to someone else.
Diagram two different approaches to the same problem and compare their decision point and loop counts to see which one is structurally simpler.
Discover more prompts that could help with your workflow.
Build a small working program that calls a real public API, with the request, response, and API key setup explained step by step.
Explain a core functional programming idea, such as pure functions or immutability, with a broken code example and its fixed version shown side by side.
Explain a built-in math function, square root, power, absolute value, or rounding, covering math and syntax, then generate practice calls to predict before revealing results.
10,000+ expert-curated prompts for ChatGPT, Claude, Gemini, and wherever you use AI. Our extension helps any prompt deliver better results.