The gender gap in science, technology, engineering, and math (STEM) engagement is large and persistent. This gap is significantly larger in technological fields such as computer science and engineering than in math and science. Gender gaps begin early; young girls report less interest and self-efficacy in technology compared with boys in elementary school. In the current study (N = 96), we assessed 6-year-old children’s stereotypes about STEM fields and tested an intervention to develop girls’ STEM motivation despite these stereotypes. First-grade children held stereotypes that boys were better than girls at robotics and programming but did not hold these stereotypes about math and science. Girls with stronger stereotypes about robotics and programming reported lower interest and self-efficacy in these domains. We experimentally tested whether positive experience with programming robots would lead to greater interest and self-efficacy among girls despite these stereotypes. Children were randomly assigned either to a treatment group that was given experience in programming a robot using a smartphone or to control groups (no activity or other activity). Girls given programming experience reported higher technology interest and self-efficacy compared with girls without this experience and did not exhibit a significant gender gap relative to boys’ interest and self-efficacy. These findings show that children’s views mirror current American cultural messages about who excels at computer science and engineering and show the benefit of providing young girls with chances to experience technological activities.