The Scratch pen tool is a fun extension to any Scratch project and teaches kids about conditionals and events. Scratch coding is a great way to introduce fundamental coding concepts to kids and teens. Once they have the basics down, Scratch is powerful enough to make robust apps and games. The pen tool is especially great for creative and drawing projects.

Kids who want to dive in and develop their Scratch skills can learn live from expert instructors. Take a look at our top-rated Scratch classes for kids.

In this article, I’ll show you how to setup the pen tool and creative ways to use it in your project.

What does the pen tool do? 

The Pen tool acts like a digital pen where users can draw, create patterns, and make interactive graphics directly on the Scratch canvas. A mouse or a sprite acts as a pen and draws a line from its center. The Pen can be used to draw simple shapes and lines all the way up to using loops and conditionals to draw complex images and patterns. 

It’s a fun way for kids to enhance their projects. My students especially enjoy the pen projects because they love being able to draw freehand. The Pen tool is often used for creative projects, such as designing art, animating visual effects, or building interactive activities like drawing apps.

Set Up the Pen Tool in Scratch

The Pen blocks are not one of the standard blocks in Scratch so it needs to be added as an extension. To do that, follow these simple steps:

  1. Visit scratch.mit.edu
  2. Login to your Scratch account
  3. Click on the Create button
Create a new Scratch project
  1. Under the blocks, click Add an Extension
Add a scratch Extension
  1. Select Pen
pen tool

Once you’ve applied the extension, you should see a new set of blocks in the block palette called Pen. These blocks will control the Pen application in your project.

see the new pen blocks

Pen Blocks in Scratch

There are a just a handful of Pen blocks, but they can accomplish a lot! 

erase all block

erase all: Clears all drawings made with the pen tool on the stage. It erases everything drawn without affecting the backdrop or sprites themselves

stamp block

stamp: Copies the current look of the sprite onto the stage as a static image. It’s often used with “Pen Down” and “Pen Up” to create patterns, tiled images, or animated scenes.

pen up block

pen up: Lifts the pen off the stage, stopping any drawing until “pen down” is used again. This is helpful for moving a sprite without drawing a line.

pen down block

pen down: This command starts drawing whenever the sprite moves. It’s used to make continuous lines as the sprite moves across the stage.

set pen color black

set pen color to [color]: Allows users to change the color of the pen. This is often used to add colorful designs and drawings.

change pen color block

change pen color by [number]: Adjusts the current color of the pen by a specific value, which can create color gradients or rainbow effects as the sprite draws.

set pen color to block

set pen color to [number]: Adjusts the current color of the pen by a specific value, which can create color gradients or rainbow effects as the sprite draws.

change pen size block

change pen size by [size]: Sets the thickness of the pen line. Larger values make thicker lines, which can be useful for emphasizing parts of a drawing.

set pen size block

set pen size to [size] Sets the thickness of the pen line. Larger values make thicker lines, which can be useful for emphasizing parts of a drawing.

Fun Ways to Use the Pen in Scratch

Using the pen tool is kind of like drawing on paper, with a twist. By combining the pen blocks with loops, variables, and other blocks, kids can create all kinds of art and animations. These are just some of the cool things you can do with the pen tool. 

Draw Freehand

You can use any sprite as a pen and draw with it. If you want it to look like you’re drawing with your mouse, simply hide the sprite. This code allows you to draw when your mouse is clicked. You can also set the pen color and size. 

draw freehand block

Example project: Paint App

Our student, Kiera, created this simple painting app where the user can make multiple brush selections.

paint app project in Scratch

View project

Draw Shapes (with Math)

There are several ways to draw shapes using the pen tool. You can simply use a series of blocks to guide your sprite. Using math, you can build shapes quickly and easily.

To create any shape you need to know:

For example, this code will draw a triangle with 3 sides that are each 100 pixels. The number of sides is 3 and the angle to turn is 120. Set your sprite to start at the beginning of the shape.

Drawing shapes block

Example project: Pen Shape Drawer

In this app, users can choose the number of shapes, sides, and the size of the lines to generate a drawing. 

Pen shape project

View project

Customize pen colors and size

Add your own style and creativity to your project by customizing the pen color and sizes. You can use the “set pen color to” block with an RGB color and “set pen size to” block with a number of pixels. You can even use variables and loops to change these features as you’re drawing with the “change pen color to” and “change pen size to” blocks.

This code draws a 5px line in turquoise when the pen is down:

customize pen size and color

Example project: Pen Paint

The Pen Paint app uses buttons to controls the size and color of the pen to create beautiful drawings.

View project

Use variables

Using a variable makes your application more flexible and robust. Allow users to select the color and size for the pen dynamically. You can also change the color and size with code as you draw. By adding variables the possibilities are endless.

Set the pen’s thickness based on a number variable with this code:

Set pen variable
pen block with variables

Example project: Paint App

Our student, Kiera, created this painting app that takes user input and has buttons to create shapes with a click.

paint app project

View project

Animation

The pen tool can draw shapes and change the size and color of the pen dynamically. This makes it possible to create unique effects in your program. 

This code creates an ongoing circle animation using the pen tool:

animation code blocks

Example project: Pen Animation #1 Tutorial

Watch this colorful and entrancing animation that uses just a few pen blocks. 

pen animation project

View project

Using loops with the pen tool

You can use loops in combination with the pen tool to create cool drawings and effects. Create complex shapes using the loop blocks. This code repeats a hexagon drawing to create a unique new shape.

pen tool with loop

Example project: Fruit Ninja

Fruit Ninja is a student favorite where we cut the fruit using a line drawn with the pen tool. 

fruit ninja project

View project

3D Drawings

The pen tool can also be used to make 3D drawings. Even though Scratch doesn’t provide tools specifically for creating 3D art, a combination of existing blocks and the pen tool can help you create the illusion of 3D graphics.

One way is to create multiple layers with stamps, to create a 3d effect. We applied this to create a 3d block.

3d drawings blocks in Scratch

Example project: 3D Maze Rendering

Go beyond the flat 2D drawings and render 3D graphics with the pen tool.

3d maze rendering project

See project

Project Ideas Using the Pen Tool 

Do you need some inspiration for your first pen project? You’d be surprised at everything the pen tool can do. Check out some of the most loved Scratch pen projects:

Download Free Printable Scratch Coding Tutorials PDF

Get the Rocketship Landing game and Flying Space Cat Scratch tutorials in a printable format.

Learn to Code Games in Scratch 

The pen tool is just one type of extension in Scratch. Besides the basic blocks like Controls, Motion, and Variables, there are extensions that use artificial intelligence, text-to-speech, and video sensing. Kids can learn to code in Scratch with these extensions and more in our Elementary Schoool Core Track.

In our elementary school coding program, kids, ages 8-10, use Scratch to learn fundamental coding concepts. With a solid foundation in programming concepts, they can then advance to text-based languages like JavaScript and Python.

If you want support teaching your child to code, enroll in our top-rated Scratch coding classes.