Search form

Lego Coding: Teaching Basic Coding with Legos

Teaching young students to code can be a daunting task, but if you start with pseudocoding with Legos, all students can be successful. Pseudocode is a method of writing code that is not tied to any specific programming language, making it an excellent tool for teaching children the fundamentals of programming. Learning pseudocode at an early age can help students develop problem-solving and critical thinking skills, as well as an understanding of logic and algorithms.

By teaching children pseudocode, they can learn to break down complex problems into smaller, more manageable tasks. This process of breaking down problems into smaller parts is an essential skill for both programming and life in general. Additionally, pseudocode allows children to experiment with programming concepts and ideas without getting bogged down in the specifics of any particular programming language.

Overall, teaching pseudocode to children can lay a foundation for future success in programming and beyond.


Lesson Plan: Lego Coding - Teaching Basic Coding with Lego Models

Grade Level: Elementary (3rd to 5th grade)

Objective: Students will learn basic coding concepts through the use of Lego models and pseudocoding. This lesson is important to start with BEFORE moving students to digital coding, as the concepts of following directions, vocabulary, cause-and-effect, and collaborating are all essential components of basic digital coding.

For more ideas for this lesson plan, visit the Lego Back to Back lesson plan, which has inspired this lesson plan.


  • Lego bricks
  • Whiteboard or flipchart
  • Markers
  • Student writing utensil
  • Pseudocode worksheet (provided by teacher)
    • A pseudocode worksheet is simply a graphic organizer with a numbered step column and an instruction column for students to fill out digitally or traditionally as they go through the building process.

Introduction (15 minutes):

  1. Begin by introducing the concept of coding and its importance in our everyday lives.
  2. Ask students if they have ever used Lego bricks before and what they enjoy about them.
  3. Explain that in this lesson, they will be using Lego bricks to learn about basic coding concepts.

Body (60 minutes):

  1. Divide students into small groups of 3-4 and distribute several Lego bricks to each group.
  2. Ask each group to build a simple structure with the Lego bricks.
  3. Once each group has finished building, ask them to write down the steps they took to build the structure using the provided pseudocode worksheet.
  4. After all the groups have completed the pseudocode worksheet, ask each group to share their steps with the class and display the steps on the whiteboard or flipchart.
  5. Use the steps on the whiteboard or flipchart to demonstrate how coding works in the real world.
  6. Introduce coding concepts such as sequencing, loops, and conditionals and explain how they relate to the steps written down by each group. (For more help on this vocabulary, visit for further help and more ideas after this Lego lesson.)
  7. Have students work in their groups to modify their pseudocode by adding loops or conditionals to their steps.
  8. Once they have modified their code, ask each group to rebuild their structure using the modified pseudocode.
  9. Encourage students to share their modified code and the results of their modified structures with the class.
  10. If time allows, have the groups switch their written steps to build a new structure created by another group. This will help students see their code in action, allowing for revisions of underdeveloped steps, etc.   

Conclusion (15 minutes):

  1. Review the coding concepts introduced in the lesson and have students share what they have learned.
  2. Emphasize the importance of coding in the 21st century and how it can lead to many career opportunities. 
  3. Distribute a list of online resources for students to explore coding further at home. A great place to start is Hour of Code and


Assessment will be based on student participation in the building, pseudocoding, and modification of their Lego structures. Additionally, the teacher will assess students' understanding of coding concepts through their participation in the class discussion and their ability to modify their pseudocode.


For students who may be struggling with the lesson, provide additional support through one-on-one instruction or pair them with a more advanced student in their group. Additionally, provide visual aids and examples to help reinforce the coding concepts being taught.

For students who are more advanced, encourage them to modify their pseudocode with more complex coding concepts or to build more complex structures.

Written by Deborah Andrus
Education World Contributor
Copyright© 2023 Education World