ChatDiagram
Tools/Control flow graph maker

Control flow graph maker.

Describe code or pseudocode and make a control flow graph with execution blocks, conditional edges, retries and loop-back paths. Use it to inspect the possible routes through a function, controller or transaction.

FlowchartEnter to send

Free account, no card · Export SVG, PNG or PDF

See it work

Control flow graph examples.

Same tool, four requests. Every drawing below is a real render.

What you type
Create an order-processing control flow graph: validate a cart, handle unavailable items by checking backorders or cancelling, reserve items, retry declined payments, run a fraud check, create a warehouse task, ship, investigate unconfirmed deliveries, and complete the order.
Then tryAdd a customer confirmation after payment succeeds.Change the payment retry limit to three attempts.
Flowchart: Order-processing branches
Flowchart · Sugiyama layered DAG + orthogonal routing · schematex-flowchart

Rather start from a finished drawing? Browse 1188 flowchart templates →

The drawing

What a control flow graph is.

A control flow graph, or CFG, represents the paths a program can take. Its nodes are blocks of work and its directed edges show transfers of control, including true and false branches and loop backs.

Unlike a general process flowchart, a CFG focuses on execution paths. It helps readers identify reachable blocks, cycles and alternate paths for testing or program analysis.

Standard
Sugiyama layered DAG + orthogonal routing
Engine
schematex-flowchart
Editable
Double-click text, drag nodes
Export
SVG · PNG · PDF
Flowchart: What a control flow graph is
Who uses it

Who uses control flow graphs.

Flowchart: Software engineersSoftware engineers

Payment, stock and delivery branches reviewed as a complete set of outcomes.

Flowchart: Students studying compilersStudents studying compilers

Small looping controllers used to identify nodes, edges and cycles in a program path.

Flowchart: Test engineersTest engineers

Safety checks, reject paths and repeat cycles exposed when planning branch coverage.

How it works

How to make a control flow graph in three steps.

01

Describe it

One paragraph is enough to start.

“Create an order-processing control flow graph: validate a cart, handle unavailable items by checking backorders or cancelling, reserve items, retry declined payments, run a fraud check, create a warehouse task, ship, investigate unconfirmed deliveries, and complete the order.”
02

See the drawing

Drawn by the right engine.

Flowchart: Order-processing branches
03

Say what changes

Every edit keeps a version.

Add a customer confirmation after payment succeeds.
V2 · DRAWN FROM V1, NOTHING RETYPED
FAQ

Common questions

What is a control flow graph?

A CFG represents the paths of execution through a program. Nodes are basic blocks or operations, and edges are transfers such as conditional branches, jumps and loop backs.

How is a control flow graph different from a flowchart?

A flowchart can describe any process. A control flow graph specifically models paths through program logic, so it is useful for testing, compiler work and code analysis.

Can I make a CFG from pseudocode?

Yes. Describe each block, decision, loop and exit path. Numbered basic blocks can be added when that helps the analysis.

Who uses control flow graphs?

Compiler students, software engineers, test engineers and security researchers use them to study branches, loops, coverage and program structure.

Related tools

Other drawings for the same work.

Map the paths through your program.

Free account, no card. Describe the blocks and branches to draw a control flow graph.

Open the editor