Turtle Graphics
Learn programming by drawing! Write simple commands to control a turtle and create patterns, shapes, and artwork.
Your code
Draws as you type. Ctrl+Enter runs, Ctrl+↑/↓ for history.
Examples
Tap one to load its codeFrequently Asked Questions
What is turtle graphics?
Turtle graphics is a method of programming vector graphics using a cursor (the 'turtle') on a Cartesian plane. Originally part of the Logo programming language created in the 1960s, it provides an intuitive way to learn programming concepts. You give the turtle simple commands like 'forward 50' or 'right 90' to move it around the canvas, and it draws lines as it moves.
How can turtle graphics help me learn programming?
Turtle graphics makes abstract programming concepts visual and tangible. You can learn about sequential execution, loops (using the repeat command), variables, and problem decomposition by breaking complex drawings into simple steps. Seeing immediate visual feedback for each command helps build intuition for how programs work.
What commands are available in this tool?
The tool supports movement commands (fd/forward, bk/back, rt/right, lt/left, goto, home), pen controls (pen up, pen down, color, width), shape commands (circle, filled, rect, square, triangle, polygon, star, dot), visibility controls (hideturtle, showturtle), and flow control (repeat loops with curly braces). Use the Help button for the full command reference.
Can I export my drawings?
Yes, you can export your turtle graphics drawings as PNG image files: open the ⋯ menu next to Run and choose Export PNG. The exported image is the drawing on the canvas at high resolution (at least twice the on-screen size), without the turtle cursor.
How does the coordinate system work?
The turtle starts at the center of the canvas, which is position (0, 0). The x-axis increases to the right and decreases to the left, while the y-axis increases upward and decreases downward. The turtle initially faces upward (0 degrees). Turning right increases the angle and turning left decreases it. You can move the turtle to any coordinate using the 'goto x y' command. If a drawing is bigger than the canvas, the view zooms out so all of it fits; the coordinates stay the same.