Mindmap AI · Blog

Flowchart Symbols in Programming: Definition, Functions and Examples

TL;DR

Flowchart symbols in programming, defined: what each shape does, the code it maps to, and a full grade-calculator example with a loop and a function call.

Published · Updated · 8 min read · by the Sakura5 team

Flowchart Symbols in Programming: Definition, Functions and Examples

Flowchart symbols in programming are standard shapes that each stand for one kind of instruction: an oval (terminal) marks where a program starts and stops, a rectangle is a processing step such as an assignment or calculation, a diamond is a condition that branches, a parallelogram is input or output, a rectangle with double side bars is a predefined process (a function or subroutine call), a hexagon is preparation such as setting up a loop, and arrows show the order the computer follows. The definition of each symbol is really a description of its function in the code.

That mapping is why programming courses still teach flowcharts. Before you write a line of Python or Java, a flowchart forces you to decide what the program reads, what it calculates, where it branches and when it stops. If the chart is right, the code is mostly translation.

This guide gives the definition and function of each symbol you’ll use in programming, the code each one maps to, a full worked example of a grade calculator with a loop and a function call, the mistakes that make program flowcharts hard to read, and answers to the questions students ask most.

Why program flowcharts go wrong

Most broken program flowcharts fail in one of two ways. The first is using shapes for looks rather than meaning. A beginner draws total = total + score in a parallelogram because it feels like data, or puts “print result” in a plain rectangle. A reader who knows the conventions then misreads what the program does.

The second is mixing levels of detail. One box says “Validate input” and the next says i = i + 1. The first hides a dozen instructions; the second is a single line. A good program flowchart keeps every shape at roughly one statement, and pushes anything bigger into a predefined process with its own chart.

The shapes themselves come from a formal standard, ISO 5807, which defines documentation symbols for data, program and system flowcharts. You don’t need the full list. You need the handful below and a clear sense of what each one does.

Flowchart symbols in programming: definition, function and example

Each symbol answers one question about the instruction it holds. Here is what each means, what it does in a program, and the code it usually becomes.

Flowchart symbols in programming: definition, function and example — flowchart symbols in programming definition functions
Each symbol answers one question about the instruction it holds.

1. Terminal (oval): start and end

Definition: a rounded oval or pill shape. Function: marks the entry point and every exit point of the program or function. Example: “Start” at the top and “End” at the bottom. In code, the start oval is the beginning of main() and an end oval is a return or the end of the script. A function’s own flowchart starts with an oval holding its name, like “calcAverage(scores)”.

2. Process (rectangle): do something

Definition: a plain rectangle. Function: any internal operation that changes data — an assignment, an arithmetic step, a counter increment. Example: total = 0, average = total / count, i = i + 1. If the step doesn’t read from the user, print, or branch, it belongs in a rectangle.

3. Decision (diamond): branch on a condition

Definition: a diamond with one arrow in and two arrows out. Function: evaluates a Boolean condition and sends the flow down the matching path. Example: “score ≥ 90?” with exits labeled Yes and No. In code this becomes an if/else, and when one exit points back up the chart it becomes the condition of a while loop. A switch with five cases is drawn as a chain of diamonds.

4. Input/Output (parallelogram): data in or out

Definition: a slanted parallelogram. Function: data crossing the boundary of the program — reading from the keyboard or a file, or displaying and writing results. Example: “Read score” becomes score = int(input()); “Display average” becomes print(average). For more on this one shape, see our breakdown of which flowchart symbol means input/output.

5. Predefined process (double-sided rectangle): call a function

Definition: a rectangle with an extra vertical line inside each side. Function: runs a named module, function or subroutine whose steps are defined somewhere else. Example: “letter = getGrade(average)”. This is the symbol that keeps a program flowchart to one page: the main chart shows the call, and a separate chart starting with a “getGrade(avg)” oval shows what the function does.

6. Preparation (hexagon): set up a loop

Definition: an elongated hexagon. Function: initialization that controls what follows, most often a counted loop. Example: “for i = 1 to 5”. Some teachers prefer a rectangle for i = 1 plus a diamond for i ≤ 5?; both are correct, but the hexagon is shorter when the loop is simple.

7. Connectors and arrows: hold it together

Definition: arrows (flow lines), a small circle (on-page connector) and a pentagon or home-plate shape (off-page connector). Function: arrows give the order of execution; connectors join two points of the chart without a long crossing line. Example: a circle labeled A where a branch ends and another A where it resumes. In code, arrows are simply the order of statements and the jumps that if, while and return create.

A worked example: a five-score grade calculator

Here’s a small program that uses every symbol above. The task: read five exam scores, compute the average, convert it to a letter grade with a function, and print both. Scores are 0–100; anything outside that range is rejected and asked for again.

Terminals. One start oval, “Start,” and one end oval, “End.” The function chart has its own pair: “getGrade(avg)” and “Return letter.”

Process. “total = 0” before the loop, “total = total + score” inside it, and “average = total / 5” after it.

Preparation. A hexagon, “for i = 1 to 5,” wraps the read-and-add steps. Its loop-back arrow returns from “total = total + score” to the hexagon; its exit arrow goes to the average step.

Input/Output. “Read score” inside the loop, and “Display average and letter” just before End.

Decision. “0 ≤ score ≤ 100?” right after Read score. No loops back to Read score without advancing i; Yes continues to the add step. The function chart holds three more diamonds in a chain: “avg ≥ 90?” returns A, “avg ≥ 80?” returns B, “avg ≥ 70?” returns C, and the last No returns F.

Predefined process. “letter = getGrade(average)” sits between the average step and the display step.

Count the shapes in the main chart: 2 ovals, 3 rectangles, 1 hexagon, 2 parallelograms, 1 diamond and 1 predefined process — 10 shapes, which fits comfortably on a page. Now trace a test case before coding. Scores 92, 85, 101, 78, 88, 70: the 101 is rejected and re-read, so the five valid scores sum to 413, the average is 82.6, and getGrade returns B. If your arrows produce that result, the logic is right and the code almost writes itself.

Notice that every line of that code has a shape on the chart, and every shape has a line. That one-to-one match is the real definition of a good program flowchart.

Plan the logic before you draw the shapes

The hardest part of a program flowchart isn’t the symbols. It’s knowing the steps, the conditions and the edge cases before you start placing diamonds. Students who jump straight to shapes end up redrawing the chart three times because they discover the validation rule halfway through.

Plan the logic before you draw the shapes — flowchart symbols in programming definition functions and examples
The hardest part of a program flowchart isn’t the symbols.

A faster order is to list the program’s inputs, outputs, calculations and decisions as a rough tree first, then convert each branch into a symbol. Mindmap AI works well for that stage: type the task, such as “grade calculator with input validation,” and it generates a first set of branches you can edit, reorder and expand on an infinite canvas, so the missing edge case shows up while it’s still cheap to add. Once each branch is labeled as input, process, decision or call, drawing the flowchart is mechanical.

If you’re charting a business process rather than a program, the same idea applies with fewer symbols; our guide to making a flowchart for a process walks through that version.

Rules that keep program flowcharts readable

  • One statement per shape. If a box needs two lines of code, it’s probably two boxes or a function call.
  • Label every decision exit. Yes/No, or True/False, on each arrow leaving a diamond.
  • Flow top to bottom. Only loop-back arrows go upward, and they should enter just above the condition they repeat.
  • One chart per function. Every predefined process should have a matching chart that starts with an oval carrying the function’s name and parameters.
  • Use the real variable names. “total = total + score” is easier to code from than “add the score.”

Follow those five and the chart doubles as documentation: anyone on your team can check the logic without reading the code. When you need to share the plan behind it, Mindmap AI can export the map as a multi-page PDF outline (a Pro feature), so the reasoning travels with the diagram.

FAQ

What are the basic flowchart symbols used in programming?

The basic flowchart symbols used in programming are the oval for start and end, the rectangle for a processing step, the diamond for a decision, the parallelogram for input and output, and arrows for flow of control. Add the predefined process for function calls and the hexagon for loop setup once your programs use modules and counted loops.

Which flowchart symbol represents a function?

A function call is drawn with the predefined process symbol, a rectangle with an extra vertical line inside each side. It tells the reader that the steps are defined in a separate chart. That separate chart starts with an oval holding the function name and parameters and ends with an oval for the return value.

How do you show a loop in a flowchart?

You show a loop with a decision diamond whose exit arrow points back up to an earlier step, so the flow repeats until the condition changes. For counted loops, many courses use a hexagon preparation symbol such as “for i = 1 to 10” instead. Either way, the loop-back arrow should be clearly labeled.

Is a flowchart the same as pseudocode?

No. Both describe an algorithm before you write real code, but a flowchart shows the logic as connected shapes, while pseudocode writes it as structured plain-language lines. Flowcharts make branches and loops easier to see at a glance; pseudocode is faster to write and closer to the final code. Many programmers sketch one and then write the other.

← All articles

Turn any idea, article, or URL into a beautiful mind map.

Mindmap AI — Type a topic, paste a long text, or drop in a URL — Mindmap AI reads it and builds a complete, beautifully organized mind map on an infinite canvas.

Download Mindmap AIfree on the App Store

About Mindmap AI · More Sakura5 apps

Keep reading

 

GATE 2027 Study Plan: How to Prepare in 5 Steps
Mindmap AI · November 13, 2026 · 6 min read

GATE 2027 Study Plan: How to Prepare in 5 Steps

GATE 2027 study plan after the November 2026 registration extension: map the syllabus, rate topics, weight by weakness, and schedule mocks. Worked example.

How to Get a Good Summary of a 60-Page Lecture PDF
Mindmap AI · November 13, 2026 · 7 min read

How to Get a Good Summary of a 60-Page Lecture PDF

How can you get a good summary of a 60-page lecture PDF? Split it into chunks, summarize from memory, then join them into one map. Full workflow.

Mindmap Mac Kostenlos: Free Mind Mapping on a Mac
Mindmap AI · November 12, 2026 · 6 min read

Mindmap Mac Kostenlos: Free Mind Mapping on a Mac

Looking for a mindmap on Mac, kostenlos? Compare four free options, use a four-point checklist, and see a 40-minute worked example with no budget.