About Flowcharts
See your code come to life.
Flowcharts are a visual representation of the logic flow through a function
or method. They make the structure of code immediately obvious in a way that
reading source never quite does — especially for complex branching, looping,
and jump logic.
What are flowcharts
A picture is worth a thousand lines.
A flowchart represents the execution path through a function as a diagram of
connected nodes. Each node represents a distinct structural element —
a terminal node marks where execution starts or ends,
a code block node represents sequential statements,
a branch node represents a conditional decision,
a loop node represents a repeating construct, and
a jump node represents a transfer of control such as
a
return,
break, or
continue.
Together they give you an at-a-glance view of what your code actually does.
Supported languages
Languages DevDiagrams can flowchart.
DevDiagrams uses ANTLR4-generated
parsers to parse source code and build flowcharts. Each supported language
has a complete grammar that covers the full language syntax.
C#
DevDiagrams supports C# methods and functions including
if,
switch,
for,
foreach,
while,
do,
return,
break,
continue,
goto, and
throw
statements. Paste in one or more method declarations and each one
gets its own flowchart.
Language specification
C# Language Specification — Microsoft
ANTLR grammar
C# ANTLR4 Grammar — GitHub
Java
DevDiagrams supports Java methods including
if,
switch,
for,
while,
do,
return,
break,
continue, and
throw
statements. Both regular and generic methods are supported. Paste in
one or more method declarations and each one gets its own flowchart.
Language specification
Java Language Specification — Oracle
ANTLR grammar
Java ANTLR4 Grammar — GitHub
Python
DevDiagrams supports Python 3 functions including
if,
elif,
else,
for,
while,
return,
break,
continue, and
raise
statements. Both regular and async functions are supported, as well
as type-annotated functions. Paste in one or more function definitions
and each one gets its own flowchart.
Language reference
Python 3 Language Reference — Python.org
ANTLR grammar
Python ANTLR4 Grammar (Python 2 and 3) — GitHub
Flowchart symbols
Reading a flowchart.
DevDiagrams uses a consistent set of shapes to represent different elements
of your code. Each shape corresponds to a specific construct in the source language.
Shapes are shown at 1:1 scale using your current preference settings.
Terminal
A rounded rectangle marking the start or end
of a function. The start terminal shows the function name. End terminals appear
wherever execution leaves the function — including
return,
throw, and
raise
statements.
Code Block
A rectangle representing one or more sequential statements that contain
no branching or looping logic — assignments, expressions, variable
declarations, and similar plain statements.
Branch
A diamond representing a conditional decision —
if,
elif, or
a switch case. The T path exits to the right when the condition
is true. The F path exits downward when the condition is false.
Loop
A pair of chamfered rectangles representing a loop construct —
for,
foreach,
while, or
do/while.
The opening boundary shows the loop condition. The loop body runs between
the two boundaries. The closing boundary loops back to the opening boundary.
Switch
A hexagon representing a
switch
statement. It shows the selector expression and is followed by a series
of branch diamonds — one per case. The default case renders on the main
spine without a diamond.
Jump nodes
Circles representing transfers of control. A jump source
(top) marks where a jump originates and a jump destination
(bottom) marks where it lands. Source and destination nodes share the same
label so they can be matched visually. Hovering over either highlights both.
Labels indicate the jump type:
B —
C —
g# —
G# —
B —
break
— exits the enclosing loop or switch.
C —
continue
— skips to the loop boundary for the next iteration.
g# —
goto case /
goto default
— transfers to a specific case within the enclosing switch statement.
The number distinguishes multiple goto case statements within the same switch.
G# —
goto label
— transfers to a named label anywhere within the same method.
The number distinguishes multiple goto statements within the same method.
Features
More than just diagrams.
Source code highlighting
Hover over any node in the flowchart and the corresponding
source code is highlighted and scrolled into view in the
editor. This makes it easy to trace the relationship between
the diagram and the code that produced it.
Jump node linking
Jump nodes — representing
break,
continue, and
return
statements — are visually linked to their destination.
Hover over any jump node and all related source and destination
nodes glow, making it immediately clear where control transfers to.
Export diagrams
Export any flowchart as SVG for crisp vector graphics at any
size, or as PNG for embedding in documents and presentations.
SVG output can also be copied directly to the clipboard.
Render history
DevDiagrams remembers your previously submitted source files so
you can return to them without re-entering your input. History
retention is 30 days for free accounts, 6 months for Educational,
and 2 years for Professional.
Tips
Writing code that diagrams well.
1
Keep methods focused
Methods that do one thing produce clean, readable flowcharts.
A method with many nested conditions and loops produces a wide,
complex diagram — which is itself a signal that the method may
benefit from being broken into smaller focused methods.
2
Prefer early returns
Methods that use early returns for guard clauses produce flatter,
more linear flowcharts than deeply nested
if/else
chains. The diagram makes the difference immediately visible.
3
Watch for complex switch statements
A switch statement with many cases produces a tall diagram with
many branch nodes stacked vertically. If most cases share the
same body, consider whether a lookup table or dictionary would
be a cleaner design — the flowchart will show this clearly.
4
Use jump node highlighting
Hover over any jump node in the flowchart to see all related
source and destination nodes highlighted. This is particularly
useful in loops with multiple
break
and
continue
statements — the highlighting makes the control flow immediately clear.
5
Paste entire files
You don't have to extract individual methods — paste in an entire
class or source file and DevDiagrams will find all the methods
automatically. Use the function list panel to navigate between them
and the search box to jump directly to any method by name.
Ready to turn your function into a flowchart?
Start flowcharting →