Coding for kids: a practical guide for parents and teachers
The best way to teach kids to code is in stages: at 5-7 through unplugged games and picture blocks, at 8-11 in Scratch and by making their own games, and from about 12 in text-based code, meaning HTML and CSS, Python and JavaScript. Age is only a guide. Short, regular sessions and projects the child dreams up matter most.
You don't need to know how to code to help. This guide covers learning by age, free resources, choosing a course, motivation, screen time and safety, plus tips for teachers.
Why teach kids to code
The goal isn't to raise a little programmer but to teach a way of thinking: splitting a problem into small steps, putting them in the right order, checking the result and fixing mistakes. That helps with maths, essays and any bigger project.
Coding also makes failure feel normal, because a program that doesn't work is part of every developer's day. Instead of "I can't do it", the child starts saying "I don't know why it doesn't work yet", and goes from consumer of games and apps to creator. Scratch's creators point out that children making their own projects learn to think creatively, work together and reason systematically.
What to learn at each age
Treat the age brackets as a rough guide. Three questions matter more than age: can the child read independently, can they handle a keyboard, and how long can they focus on one task?
| Age | How they learn | Example tools | What they learn | The adult's role |
|---|---|---|---|---|
| 5-7 | Unplugged games, picture blocks on a tablet | CS Unplugged, ScratchJr | Order of steps, repetition, simple conditions | Plays along and reads instructions aloud |
| 8-11 | Block coding, their own games, simple devices | Scratch, Blockly Games, micro:bit, Hour of AI | Loops, conditions, variables, events, finding bugs | Asks about the project and helps plan it |
| 12+ | Text-based code, websites, scripts and games | HTML and CSS, Python, JavaScript | Syntax, functions, documentation, bigger projects | Helps find a goal and keeps practice regular |
Ages 5-7: unplugged coding and first blocks
Younger children learn best through movement, for example in the robot game: an adult plays a robot that follows only exact instructions, and the child writes a program for it on cards laid out on the floor:
PROGRAM: the robot goes to the kitchen
1. Take 3 steps forward.
2. Turn right.
3. Repeat 2 times: take 2 steps.
4. If the door is closed, open the door.
5. Say: I'm here!These five lines hold three foundations of programming: sequence, a loop (repeat) and a condition (if). When the robot bumps into the wardrobe, the child finds the bug and fixes the program. That's their first debugging. The free CS Unplugged project from the University of Canterbury has ready-made games like this, with lessons grouped by age.
For a first screen, try ScratchJr, a free app for iPads, Android tablets and Chromebooks. Children aged 5-7 create interactive stories and games in it, joining graphical blocks to get characters walking, jumping, dancing and singing. Use it together, in short sessions.
Ages 8-11: Scratch, games and first projects
This is the time for Scratch, a free programming language and online community from the MIT Media Lab, now run by the nonprofit Scratch Foundation. Its creators aim it especially at ages 8 to 16. Children use colourful blocks to make games, animations and stories, the interface comes in many languages, Polish included, and the Scratch app works offline.
Real programming concepts appear here: loops, conditions, variables and events. Making a game teaches the most. A simple apple-catching game needs a moving character, randomness, collision detection and scorekeeping. The guide to coding games to learn programming has more ideas.
Also try Blockly Games, a series of free games for children who haven't programmed before, available in Polish too. The games teach loops and conditions, and in the Pond Tutor, blocks alternate with real JavaScript. The authors say that after the whole series, a child is ready for text-based languages.
Young tinkerers will like the micro:bit, a small board with LEDs, buttons and sensors, designed for young people aged 8 and up. You program it in the browser, in the MakeCode editor with blocks similar to Scratch, and switching the view reveals the JavaScript behind the blocks:
input.onButtonPressed(Button.A, function () {
basic.showIcon(IconNames.Heart)
})Press button A and the LEDs form a heart. The editor has a simulator, so you can test the program before buying the board.
The free Hour of AI activities, successors to the famous Hour of Code, are available all year. CodeAI, the nonprofit called Code.org until June 2026, runs them with partners. On its page for students, it suggests children aged 5-11 start with the Hour of AI, then move on to block coding. Check each activity's age range, as some are for ages 13 and up.
Ages 12+: HTML and CSS, Python and JavaScript
Once a child reads fluently and types comfortably (we assume roughly age 12 here), they can move on to text-based code. The concepts from blocks stay the same, but in the new notation every character counts. Three directions work well:
- HTML and CSS for quick results: a few lines and your own page appears in the browser. The guide to HTML and CSS basics walks through it.
- Python for fans of logic and puzzles, with readable syntax and the turtle module for drawing with code.
- JavaScript for future browser game makers, ideally after HTML and CSS, as in JavaScript for beginners.
A teenager's first page can look like this (save it as index.html and open it in a browser):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Dinosaurs</title>
</head>
<body>
<h1>My dinosaur page</h1>
<p>My favourite dinosaur is the <strong>triceratops</strong>.</p>
<img src="triceratops.png" alt="A drawing of a triceratops">
</body>
</html>And this is how to draw a star with the turtle module, which comes from the Logo language of 1967 and was created as an educational tool:
import turtle
pen = turtle.Turtle()
pen.color("orange")
for side in range(5):
pen.forward(150)
pen.right(144)
turtle.done()Changing the repeats or the angle makes a ready-made exercise: what does the turtle draw with 36 repeats and a 170-degree angle? Book lovers may enjoy Python for Kids by Jason R. Briggs. For a comparison of first languages, see where to start learning to code, and for the career path, how to become a developer.
Free resources for teaching kids to code
You don't need to spend money to start: everything in the table is free except the micro:bit board, and its editors and simulator cost nothing.
| Resource | Age according to its creators | What the child does | Format |
|---|---|---|---|
| CS Unplugged | Lesson groups, e.g. 5-7 and 8-10 | Computer science games and puzzles | No computer |
| ScratchJr | 5-7 | Stories and simple games | Picture blocks on a tablet |
| Scratch | Especially 8-16 | Games, animations, remixes | Blocks in a browser or app |
| Blockly Games | Children with no experience | Mazes, drawing, music | Blocks, then JavaScript |
| micro:bit | 8+ | Programs for a board with sensors | Blocks, JavaScript, Python |
| Hour of AI and CodeAI courses | 5-11 and 11+ | Short activities and courses | Blocks and code in the browser |
| Code Club projects | School-aged children | Step-by-step projects | Scratch, Python, HTML, micro:bit |
How to choose a course or classes
An ad won't tell you how well a class teaches, so before you sign your child up, check:
- Does the child create, or just click? Good classes end with a project to show: a game, an animation, a page.
- Does the level fit? Ask whether the child must read and type on their own.
- Is there a path forward? Text-based code should follow blocks, not another year of similar exercises.
- Who teaches, and how big is the group? With younger kids, a patient teacher and a small group matter more than a trendy technology name.
- What about safety? What data is collected, can children message each other privately, and who moderates comments?
- Can you try it for free? A trial lesson or a free plan shows whether your child enjoys it.
Match the format to your child, too: an app gives flexibility, group classes motivate through peers, and sessions with a mentor fit the pace and topics to the child.
How to help your child when you can't code
You don't need to know the answers. Your role is like a coach's: you ask, listen and help organise the thinking.
- Ask instead of hinting. "What was supposed to happen?", "What happened instead?", "Which part does that?". These questions uncover most bugs.
- Ask them to explain the program. Talking through each block, a child often finds the bug alone. Developers call this rubber duck debugging.
- Keep your hands off the mouse. Point and ask, but let the child click.
- Learn together. Do a first Hour of AI activity or a ScratchJr story side by side. Your "I don't know, let's check" is a great lesson.
- Help with planning. Read instructions to younger kids, and sketch a game on paper with older ones: what the player does, how you win, when it ends.
- Build a routine. Fixed days and times beat "whenever there's time".
When you're both stuck, look for help together: in a search engine, on the Scratch forums or from a computing teacher. Older teens who want to learn alone can follow the plan in how to learn to code.
Motivation: how to keep your child coming back
Kids rarely quit coding because it's too hard. More often, it stops feeling like theirs. Simple principles help:
- Start with their interests. A football fan can make a penalty shootout game, a horse lover an animated race.
- Pick small projects you can finish. Every "it works!" fuels the next step.
- Hold family demos. A child who explains their game to grandparents reinforces what they know and feels proud.
- Praise strategy, not talent. Instead of "you're a genius", say "I liked how you tracked down that bug step by step".
- Use remixes. In Scratch, you can build on other people's projects if you credit the authors and make meaningful changes.
Points, levels and badges add motivation, but make sure collecting rewards doesn't replace creating.
Screen time and online safety
Making a game is different from scrolling through videos, but it's still time sitting still in front of a screen, so agree on rules before arguments start.
How much screen time
In its guidelines for children under 5, the World Health Organization recommends that children aged 2-4 spend no more than one hour a day on sedentary screen time, and less is better. For children and teens, the WHO recommends an average of 60 minutes of moderate to vigorous physical activity a day. Coding should complement movement and sleep, not replace them.
The American Academy of Pediatrics suggests a family media plan with your own priorities, such as screen-free zones at the dinner table, during homework and before bed. It also helps when each session has a clear end, followed by a movement break.
Safety and privacy
The Scratch Community Guidelines ask users not to share details that allow private contact: real last names, phone numbers, addresses, hometowns, school names or email addresses. Inappropriate content can be reported to moderators, and Scratch's creators encourage parents to read the guidelines with their child, which is good practice on any site. To start:
- create accounts together, using your own email address where the site asks for one,
- choose a username that doesn't reveal your child's name or school,
- check minimum ages in the terms, especially for AI tools (for example, the Claude.ai terms require users to be at least 18),
- agree that your child will come to you when something online worries them, without being punished for it.
Tips for teachers
- Start without computers. CS Unplugged lessons and the robot game work with a whole class.
- Pair up. One pupil arranges blocks, the other reads and checks, and they swap roles every few minutes.
- Use December. In 2026, Computer Science Education Week runs from 7 to 13 December, a good time for a school Hour of AI event.
- Start a club. Code Club from the Raspberry Pi Foundation runs free clubs for school-aged young people in more than 100 countries, with step-by-step projects.
- Assess projects, not definitions. A game demo and an answer to "how does it work?" say more than a test on block names.
Coding for kids at CodeWorlds
CodeWorlds teaches coding as a game: courses are story worlds, and every lesson has code editor tasks, questions and puzzles that earn levels and experience points. Three courses suit children and teens best:
- Ancient Egypt (HTML and CSS, ages 7+): 9 modules, 429 exercises and, per the course description, 40-60 hours of learning. Basic computer skills and a web browser are enough. A younger child will do best with an adult who helps read the instructions.
- Safari (Python, ages 12+): 12 modules, 450 exercises, 60-80 hours.
- Jurassic Park (JavaScript, ages 13+): 10 modules, 601 exercises, 60-90 hours, assuming HTML and CSS basics.
To try it, open the Introduction to HTML lesson and the Egyptian explorer's business card mini-project, or with a teen, the Welcome to Python Safari lesson or the first steps in the JavaScript console. Other courses are on the course list. The lessons of all courses are free to read on the site. A free account covers the HTML and CSS course in the app and gives you 10 fuel units a day for exercises, which suits short daily sessions, while the Python and JavaScript exercises in the app need the premium plan.
If your child needs a person alongside them, the online sessions page has a section of live sessions for kids. These are one-hour meetings in which the child codes with a mentor on a topic of their choice. There are sessions on computer skills and online safety, programming in Scratch, Minecraft and building a browser game.
FAQ
At what age can a child start learning to code?
Unplugged games suit even preschoolers, ScratchJr is designed for ages 5-7 and Scratch especially for ages 8 to 16. Text-based code usually fits from around 12.
Does my child need to be able to read to code?
Not at first. The robot game needs no reading, and in ScratchJr children join graphical blocks, so an adult's help is enough. In Scratch, reading helps a lot, and for text-based code it's essential, as is typing.
Scratch or Python: which should come first?
For ages 8-11, Scratch is better: blocks only fit together in valid ways, so there are no syntax errors, and results show instantly. A teen who types comfortably can start with Python. Loops, conditions and variables from Scratch carry over to every language.
How much time should a child spend coding?
There's no single standard. Sessions of 15-20 minutes suit younger children and 30-45 minutes older ones, two or three times a week. Make sure movement and sleep don't suffer.
Can kids learn to code for free?
Yes. ScratchJr, Scratch, Blockly Games, CS Unplugged, the Hour of AI and Code Club projects are free, and with the micro:bit you only pay for the board. At CodeWorlds, a free account covers the HTML and CSS course in the app with a limit of 10 fuel units a day, and the lessons of all courses are free to read on the site.
Can my child learn to code with the help of AI?
Yes, in moderation and with an adult nearby. First check the minimum age in the tool's terms, then let AI explain errors rather than write code for your child, because a ready-made solution teaches nothing.