Turtle Art Online: How to Start Drawing with Code
In this article
Turtle Art online is the browser version of Turtle Blocks, free at turtleart.org, where you snap colored command blocks together to make a turtle draw geometric art. No installation, no account needed to draw and save work to your own computer. The one rule to remember: the turtle always starts at the center of the canvas, facing up, with a black pen.
Open the site, drag a forward block and a right block into the program area, click them, and a line appears. That two-block program is the seed of everything else on the page.
The Blocks That Do the Drawing
Four blocks generate almost all turtle art. Forward moves the turtle a number of steps in the direction it faces; back moves it the other way. Right and left rotate the turtle in place by a number of degrees. The pen draws only while the turtle moves, not while it turns.
Number slots accept any whole number, and clicking a block after the program runs lets you step through it one command at a time. That matters for debugging: if a shape closes wrong, stepping shows exactly which turn was off.
Turning Two Blocks into Polygons
A polygon is one edge repeated with the same turn. The working rule: the turn angle is 360 divided by the number of sides. A square uses forward 100 and right 90, repeated 4 times. A hexagon uses forward 80 and right 60, repeated 6 times. A triangle uses right 120, repeated 3 times.
Put those two blocks inside a repeat block and set its count, and you have a closed shape. Because 4 × 90 = 360, 6 × 60 = 360 and 3 × 120 = 360, the turtle ends each polygon facing exactly where it started, which is why the shape closes.
Repeat and Nested Loops Make the Art
Single polygons are geometry; turtle art comes from repeating polygons while something changes. Nest one repeat inside another: the inner loop draws a polygon, the outer loop rotates the turtle a few degrees between polygons. A square drawn 36 times, turning 10 degrees after each one, fills a full circle (36 × 10 = 360) and produces a dense mandala pattern.
Change only the inner shape or only the rotation angle and the family of patterns changes completely. A 5-degree outer rotation gives 72 overlapping shapes; a 30-degree rotation gives 12, with visible gaps between them.
Pen, Color and Speed Controls
The pen up block stops drawing so the turtle can move to a new spot without leaving a trail; pen down resumes. Use it to place several separate polygons on one canvas. The set color block takes a number from 0 to 99, where different ranges shift the hue; set pen size controls line thickness, typically 1 to 10 for crisp results. A set hue or color-change block placed inside a loop makes each repeated shape a different color, which is the fastest route to rainbow effects.
Labels can differ slightly by version of the environment, but the block shapes and colors stay recognizable across the Turtle Blocks family.
Saving and Sharing Your Drawings
Projects save as files to your own device through the browser's save option, and the artwork itself exports as an image. This is the point of the browser version: nothing lives on a server under your name, so your work exists only where you put it. Keep project files if you want to reopen and edit later; keep the image export for sharing.
Reload the page and the canvas clears, so save before navigating away.
Where Beginners Go Wrong First
The most common slip is expecting the turtle to draw while turning. It does not: turning is silent, only forward and back leave ink. If your shape has gaps, the missing segments were turns, not broken commands.
The second slip is a wrong repeat count. If a hexagon program uses right 60 but repeats 5 times, the shape stays open with a 60-degree gap. Count sides and turn angle so their product is 360, or accept the open spiral on purpose, which is itself a classic turtle art effect.
Third, a very small forward value with a very large repeat count can make the program appear frozen. Reduce the repeat count or enlarge the step, and the drawing finishes in seconds.
First Five Programs Worth Typing
Start with a square: forward 100, right 90, repeat 4. Then a hexagon: forward 80, right 60, repeat 6. Then the 36-square mandala: square program nested inside repeat 36 with right 10 between squares. Fourth, pen up, forward 200, pen down, and draw a second smaller square elsewhere on the canvas. Fifth, put a set color block inside the mandala's inner loop so every square shifts hue.
Each program takes under a minute to build and teaches one mechanism: closure, rotation, nesting, pen state and color over time. After those five, the natural next step is replacing fixed numbers with variables so a slider can change the polygon's side count while the drawing runs.