Learn to code with Scratch โ start from nothing, build anything!
โจ Taught by Monty, aged 11Scratch is a free coding tool made by MIT for kids just like you! Instead of typing complicated code, you snap together colourful blocks โ just like LEGO, but for making games, stories, and animations.
๐ Over 100 million kids around the world use Scratch. You can make anything you imagine โ and even share it with others!
Click any lesson card to open the full guide!
Create your free Scratch account, learn what the screen looks like, and make your first sprite move!
By the end of this lesson you'll have a free Scratch account, know what every part of the screen does, and have made your very first sprite move!
Go to scratch.mit.edu in your browser. Ask a parent to help if needed.
Click "Join Scratch" in the top right and fill in a username and password. Don't use your real name in the username!
Once logged in, click "Create" at the top to open the Scratch editor.
The Scratch editor has four main areas:
The Scratch Cat is already on your stage. Click it in the sprite list to select it.
Click Events (yellow) in the block palette. Drag a When ๐ฉ clicked block into the scripts area.
Click Motion (blue). Drag a Move 10 steps block and snap it underneath.
Click the green flag above the stage. The cat moves right! Click again and again โ the cat keeps walking.
๐ Challenge: Change the number in the Move block to 50. What happens? Try -10 โ which direction does the cat go?
Make your sprite walk, turn, glide, and bounce around the screen using blue Motion blocks.
Motion blocks are blue. They control where your sprite moves, which direction it faces, and how it gets around the stage.
Add a When ๐ฉ clicked block.
Snap a Forever loop underneath (from Control section).
Inside the Forever loop, add Move 10 steps then If on edge, bounce.
Press the green flag โ your sprite bounces back and forth forever!
๐ Challenge: In the sprite settings (below the stage), set rotation style to "left-right only" so it doesn't flip upside down. Try changing the speed to 5 or 20 โ what difference does it make?
Change costumes, make speech bubbles, resize your sprite, and create cool visual effects!
Looks blocks are purple. They control how your sprite appears โ what it says, what it wears, how big it is, and any special effects.
Click the Scratch Cat and then the Costumes tab at the top. Notice it has two costumes with legs in different positions!
Go to the Code tab. Build: When ๐ฉ clicked โ Forever โ Next costume โ Wait 0.2 secs.
Press the green flag โ the cat animates like it's walking! Now add Move 5 steps and If on edge, bounce inside the loop too.
Before the Forever loop, add Say "I'm walking!" for 2 secs so the cat introduces itself first.
๐ Challenge: Add a second sprite. Make it say "Hello!" when the flag is clicked. Can you make both sprites say things one after the other?
Add sound effects, record your own voice, and compose music for your projects!
Sound blocks let you play sounds, record your own voice, and build music into your projects. They make everything feel much more alive!
Select your sprite and click the Sounds tab. Click the speaker icon with a + (bottom left) to browse hundreds of free sounds. Try "Pop", "Drum", "Laser" or "Cheer"!
In the Code tab, add: When [Space] key pressed โ Play sound [Pop] until done.
Press the green flag then tap the spacebar. Your sound plays! Try adding different sounds to different keys.
๐ Challenge: Click the Record button in the Sounds tab to record your own voice. Make your sprite play your recording when clicked!
Use "repeat" and "forever" loops to make your code run again and again without retyping anything!
Loops are one of the most important ideas in all of coding! Instead of stacking the same block 100 times, a loop runs the code inside it over and over automatically.
Click the blue puzzle piece (bottom left of block palette) and add the Pen extension to get drawing blocks.
Build: When ๐ฉ clicked โ Pen down โ Repeat 4 โ inside: Move 100 steps โ Turn 90 degrees.
Press the green flag โ a perfect square is drawn! Change 4 to 3 and 90 to 120. What shape does that make?
Wrap the whole thing in a Repeat 36 loop and add a Turn 10 degrees at the end of each repeat. You'll get a beautiful spirograph pattern!
๐ Challenge: Use a Forever loop to continuously change a sprite's colour with Change [colour] effect by 25 plus a Wait 0.1 secs. It'll cycle through a rainbow!
Make decisions in your code โ this is where things get really exciting!
If/Then logic lets your code make decisions. "IF this thing is true, THEN do this." Without it, your project just runs the same way every time no matter what.
Make a sprite follow the mouse: When ๐ฉ clicked โ Forever โ Point towards [mouse pointer] โ Move 3 steps.
Inside the Forever loop, add an If <> then / else block. Put Touching [mouse pointer]? in the diamond gap.
In the "then" part: Set [colour] effect to 50 and Say "Got you! ๐" for 0.5 secs.
In the "else" part: Set [colour] effect to 0. Now move your mouse around โ the sprite chases you and changes colour when it catches the cursor!
๐ Challenge: Add a second sprite. Use If touching [Sprite2]? then to detect collisions between sprites and trigger a sound or a game-over message!
Store scores, lives, and timers in variables โ essential for making real games!
A variable is like a labelled box that stores a number or word. The value can change while your project runs. You need variables for scores, lives, timers โ basically every real game uses them!
In the block palette, click Variables. Click "Make a Variable" and name it Score. Click OK.
New blocks appear: Set [Score] to 0 and Change [Score] by 1. A live score counter also appears on the stage!
Make two variables: Score and Lives.
At the very start of your script, set Score to 0 and Lives to 3.
When a sprite touches the mouse pointer, use Change [Score] by 1 to add a point.
Add: If [Score] = 10 then โ Say "You win! ๐" โ Stop [all]. First to 10 wins!
๐ Challenge: Make a countdown timer! Create a Timer variable set to 30. Use Change [Timer] by -1 inside a loop with Wait 1 secs. When it hits 0, say "Time's up!"
Make sprites talk to each other and create complex multi-sprite stories and games.
Broadcasting is like sending a radio signal โ one sprite shouts a message, and any sprite that's "listening" reacts to it. This is how you get multiple sprites to coordinate and create proper scenes.
Add two sprites โ Cat and Dog. Position them on opposite sides of the stage.
On the Cat: When ๐ฉ clicked โ Say "Hello Dog!" for 2 secs โ Broadcast [cat-spoke].
On the Dog: When I receive [cat-spoke] โ Say "Hello Cat! ๐พ" for 2 secs โ Broadcast [dog-spoke].
Back on the Cat, add a new script: When I receive [dog-spoke] โ Say "Nice to meet you!" for 2 secs.
Press the green flag. The cat speaks, the dog responds, the cat replies โ a full conversation, perfectly timed!
๐ Challenge: When the cat reaches the edge of the screen, broadcast "new-scene". Have the Stage listen for that message and switch to a different backdrop. Instant scene change!
Store lots of data using lists โ perfect for quizzes, leaderboards, and inventory systems!
A variable holds one thing at a time. A list holds many things โ like a shopping list. Each item has a position number. The first item is position 1, the second is position 2, and so on.
In the block palette, click Variables. Click "Make a List" and name it Questions.
A list box appears on the stage. Click the + at the bottom to add items. Type in some quiz questions, one per slot.
Create two lists: Questions and Answers. Add 3 matching pairs โ e.g. "What colour is the sky?" / "blue".
Create a variable called QuestionNumber set to 1, and a Score variable set to 0.
Add a Repeat [length of Questions] loop. Inside it: Ask [item QuestionNumber of Questions] and wait.
Use If [answer] = [item QuestionNumber of Answers] then to check the answer. Say "Correct! โ " or "Wrong! โ" and update the score.
After the if block, add Change [QuestionNumber] by 1 to move to the next question.
๐ Challenge: After all questions, say the player's final score: combine "You scored " + Score + " out of 3" using the Join block in the Operators section!
Click a project card to see the full step-by-step build guide!
Make a cat sprite follow your mouse cursor. Score points when it catches you!
Just the default Scratch Cat โ no extras needed. Great first project!
Follow the mouse. Build: When ๐ฉ clicked โ Forever โ Point towards [mouse pointer] โ Move 4 steps.
Add a score. Make a Score variable. Before the Forever loop, add Set [Score] to 0.
Detect the catch. Inside the Forever loop: If [touching mouse pointer?] then โ Change [Score] by 1 โ Play sound [Meow] until done โ Wait 0.5 secs.
Test it! Press the green flag and move your mouse around. The cat chases you โ every catch scores a point and plays a meow!
Make it harder. Increase Move steps from 4 to 7. Try using the Bat sprite for a spookier feel!
๐ Bonus: Add a Lives variable starting at 3. Each catch loses a life with Change [Lives] by -1. When Lives = 0, say "Game Over!" and stop everything.
Control a basket to catch falling stars. Don't miss โ the speed increases as you score!
Two sprites: a Star (from the Scratch library) and a Bowl or basket. You can also draw your own basket in the paint editor!
Basket follows the mouse. On the Basket: When ๐ฉ clicked โ Forever โ Set x to [mouse x]. This slides it left and right.
Star falls from the top. On the Star: When ๐ฉ clicked โ Go to x: [pick random -200 to 200] y: 170 โ Forever โ Change y by -4.
Catch it! Inside the Forever loop on the Star, add: If [touching Basket?] then โ Change [Score] by 1 โ Play sound [Collect] โ respawn with Go to x: [pick random -200 to 200] y: 170.
Reset if missed. Add another If: If [y position < -165] then โ respawn the star at the top again.
Add difficulty. Make a Speed variable. Start it at -4. Each time the star is caught, use Change [Speed] by -0.3 so the star falls faster and faster!
๐ Bonus: Add a bomb sprite that also falls. If the basket catches it, lose a life! Use an If/Else to check if you caught a star or a bomb.
Build a working piano you can actually play using your computer keyboard!
Add the Music extension first โ click the blue puzzle piece icon at the bottom left of the block palette and select "Music". This gives you note-playing blocks!
Set the instrument. Add When ๐ฉ clicked โ Set instrument to [Piano]. This makes all notes sound like a real piano.
Map the first key. Add a new script: When [a] key pressed โ Play note [60] for [0.5] beats. Note 60 is Middle C.
Add all 8 notes (C major scale): a=60 (C), s=62 (D), d=64 (E), f=65 (F), g=67 (G), h=69 (A), j=71 (B), k=72 (high C). Create a new script for each key!
Visual feedback. On each keypress, add Set [colour] effect to 50 โ Wait 0.1 secs โ Clear graphic effects. The sprite flashes when you play!
Try a tune! Can you play "Mary Had a Little Lamb"? The notes are: E D C D E E E (d s a s d d d).
๐ Bonus: Change the instrument to Guitar, Violin, or Drums using the instrument number. Try instrument 2 for piano with a different tone, or 18 for a xylophone!
Draw a maze, drive through it with arrow keys, and try to beat the clock!
A small car sprite (try "Convertible" from the library โ shrink it to about 30% size) and a maze backdrop. Draw your maze in the backdrop editor using thick black lines for walls. Add a green rectangle at the finish!
Set start position. On the car: When ๐ฉ clicked โ Go to x: -200 y: -140 (adjust to match your maze entrance) โ Point in direction 90.
Arrow key controls. Four separate scripts โ one per arrow key. Example: When [up arrow] pressed โ Point in direction 0 โ Move 5 steps. Repeat for down (180), left (-90), right (90).
Wall collision. After each Move block, add: If [touching color black?] then โ Move -5 steps. Click the black colour chip in the block, then click on a wall on the stage to match it exactly.
Finish line. After each Move, also add: If [touching color green?] then โ Say "You win! ๐" for 3 secs โ Stop [all].
Add a timer. Separate script on the car: When ๐ฉ clicked โ Set [Timer] to 0 โ Forever โ Wait 1 secs โ Change [Timer] by 1. Your best time is your lowest score!
๐ Bonus: Design two or three maze levels in different backdrops. When the car hits the finish line, broadcast "next-level" and switch backdrop. How many levels can you design?
Don't try to build a massive game on day one! Start with one sprite doing one thing, then add more.
See any cool project? Click "See Inside" to peek at their code and learn how it was made!
Press the green flag after every change to check it works. Don't write loads of code before testing!
Right-click a block and add a comment to explain what it does. Future you will be grateful!
Scratch has millions of users. Share your projects and get feedback from around the world!
You can remix (copy and improve) any public Scratch project. It's encouraged and totally fine!
New words you'll hear a lot when coding with Scratch
A character or object in your project. The default one is the Scratch Cat! You can add as many as you like.
The white area where your project runs. Like the stage at a theatre โ your sprites perform here!
A colourful puzzle piece that gives your sprite an instruction. You snap them together to write code.
A stack of blocks connected together. Your sprite follows the script from top to bottom.
The look of a sprite. By switching costumes quickly you can make animation โ like a flipbook!
The background image of the stage. Change backdrops to move between scenes in your story or game.
A box that stores a number or word. Great for keeping score, counting lives, or tracking time.
Something that starts your code running โ like clicking the green flag or pressing a keyboard key.
A block that makes your code repeat. "Forever" loops run until you stop the project.
A message sent between sprites. When one sprite broadcasts, another can listen and react!
An exact copy of a sprite made while your project runs. Great for making lots of enemies or stars!
Finding and fixing mistakes in your code. Every coder does it โ it's part of the fun!
Things kids (and parents!) often ask
I'm 11 years old and I love coding with Scratch. I built this website to share what I've learned and help other kids get started.
I think coding is like a superpower โ once you know how to do it, you can build almost anything you can imagine. And the best part? It's really fun!
If you get stuck on anything, keep experimenting. That's how all coders learn. ๐
Download and print Monty's Scratch worksheet โ perfect for beginners!
A 2-page printable worksheet with multiple choice questions, match-the-block, fill in the blanks, and a project design activity. Great for ages 7โ11!
๐ Coming soon: Worksheet 2 (Loops & Motion) ยท Worksheet 3 (Variables & Score) ยท Scratch Project Cards
Learn Scratch 1-on-1 over Zoom โ for kids aged 6 to 11!
Learning from another kid just feels different โ less scary, more fun! Monty explains things in a way that makes sense, and he genuinely loves Scratch.
30 minutes
1 hour
4 ร 1-hour lessons
๐ง Click a button above or email monty@startfromscratch.club โ a parent will reply within 24 hours to arrange a time. All sessions require a parent or guardian to be at home.