kids encyclopedia robot

Scratch (programming language) facts for kids

Kids Encyclopedia Facts
Quick facts for kids
Scratch
Scratch logo
Logo used since October 16, 2015
Scratch 3.0 editor.png
Scratch 3.0 editor
Paradigm Event-driven, block-based programming language
Developer MIT Media Lab
First appeared
  • October 2003; 21 years ago (2003-10) (prototype Scratch 0.1)
  • 2004; 21 years ago (2004) (second prototype)
  • 15 May 2007; 18 years ago (2007-05-15) (public launch)
  • 9 May 2013; 12 years ago (2013-05-09) (Scratch 2.0)
  • 2 January 2019; 6 years ago (2019-01-02) (Scratch 3.0)
Stable release
  • Scratch 3.0 (online editor) / 2 January 2019; 6 years ago (2019-01-02)
  • Scratch 3.29.1 (offline editor) / 27 February 2022; 3 years ago (2022-02-27)
Implementation language Squeak (Scratch 0.x, 1.x)
ActionScript (Scratch 2.0)
HTML5, CSS3 and JavaScript (Scratch 3.0)
OS Microsoft Windows, macOS, Linux (via renderer), HTML5(via web browser), iOS, iPadOS, and Android.
License BSD 3-Clause, GPLv2 and Scratch Source Code License
Filename extensions .scratch (Scratch 0.x)
.sb, .sprite (Scratch 1.x)
.sb2, .sprite2 (Scratch 2.0)
.sb3, .sprite3 (Scratch 3.0)
.json (Scratch 2.0 and above)
Influenced by
Logo, Smalltalk, HyperCard, StarLogo, AgentSheets, AgentCubes, Etoys
Influenced
Catrobat, ScratchJr, Snap!, mBlock, Turtlestitch

Scratch is a special kind of computer language that uses colorful blocks instead of complicated text code. It's a visual language where you drag and drop blocks to make programs. Scratch is mostly for kids aged 8 to 16, helping them learn how to code in a fun way.

On the Scratch website, you can create all sorts of projects using this block-based system. It was created by the MIT Media Lab, a famous research lab. Scratch is used all over the world and has been translated into more than 70 languages! You'll find it taught in schools, after-school clubs, and even colleges.

The name "Scratch" comes from how DJs mix music by "scratching" vinyl records. Just like a DJ mixes sounds, Scratch lets you mix different things like pictures, sounds, and code to make new projects. You can create video games, animations, music, and even simulations. As of early 2023, over 103 million people have used Scratch, sharing more than 123 million projects!

What is Scratch 3.0?

Scratch 3.0 is the newest version of Scratch, launched in 2019. It's designed to be easy to use on many devices, including tablets and phones.

How the Editor Works

Dialogo scratch Best Friends 1
A Scratch program that changes the background and makes a character speak.

The Scratch editor has three main parts. First, there's the stage area, which is where you see your project come to life. This is where your characters (called sprites) move and interact. Second, there's the block palette, which is a menu of all the different code blocks you can use. Third, there's the coding area, where you drag and drop blocks from the palette to build your program. You can start your code by clicking a green flag or by clicking on the code itself.

The stage area shows what your project looks like when it runs, whether it's an animation or a game. Sprites are listed below the stage. The stage uses an x and y coordinate system, with the center being 0,0.

When you select a sprite, you can drag command blocks from the palette to the coding area to tell it what to do. The "Costumes" tab lets you change how your sprite looks using a simple editor. You can even create animations here! The "Sounds" tab lets you add sounds and music to your sprite. You can draw your own sprites, pick one from Scratch's library, or upload your own images.

Here are the different types of programming blocks you'll find in Scratch:

Blocks in Scratch
Category What it does
Motion Makes sprites move, turn, and change position.
Looks Controls how sprites appear, like changing costumes or saying things.
Sound Plays audio files and adds sound effects.
Events Starts your code when something happens, like clicking the green flag.
Control Helps your code make decisions, repeat actions, or create copies of sprites.
Sensing Lets sprites interact with other sprites, the mouse, or the background.
Operators Does math, compares things, and joins text together.
Variables and Lists Stores information like scores or names, and keeps lists of items.
My Blocks Lets you create your own custom code blocks to reuse.
Extensions Adds more special blocks and features.

Using Scratch Offline

Scratch Beginner Scripts
Four different scripts for the getting started built-in tutorial.

You can use Scratch even without an internet connection! There's an offline "Desktop Editor" for Scratch 3.0. It works on Microsoft Windows 10, Apple's macOS, ChromeOS, and Android devices. This lets you create and play Scratch projects anywhere. Older versions of the offline editor (like Scratch 2.0 and 1.4) are also available to download.

What are Extensions?

Scratch Extensions Page
An example of the Scratch 3 Extensions Page.

Extensions add special blocks and features to your Scratch projects. In older versions, extensions were mostly for connecting to hardware. Scratch 3.0 added new software extensions, like text-to-speech voices, and more hardware extensions.

Physical Extensions

These extensions let your Scratch projects control real-world devices:

  • LEGO Mindstorms EV3 – Control robots and get info from sensors.
  • Makey Makey – Use everyday objects to control your projects.
  • LEGO Education WeDo 2.0 – Control motors and get sensor data from Lego WeDo models.
  • micro:bit – Use a micro:bit mini-computer to control projects.
  • LEGO BOOST – Make robotic creations move.
  • Go Direct Force & Acceleration – Sense pushing, pulling, and movement.

Digital Extensions

Many of these used to be regular block categories but were moved to extensions to keep the main palette tidy:

  • Music – Play digital instruments like drums, trumpets, and pianos.
  • Pen – Draw lines and shapes on the stage with different colors and sizes.
  • Video Sensing – Detects motion using your computer's camera.

New digital extensions have also been added:

  • Text to Speech – Turns written words into spoken voices.
  • Translate – Uses Google Translate to change text from one language to another.

Scratch Lab Experiments

The Scratch Lab is where the Scratch Team tries out new ideas. These experiments might become part of the main Scratch website later. Some current experiments include:

  • Video Sprites – Fill sprites with live video from your camera.
  • Face Sensing – Make projects that react to your face.
  • Animated Text – Make words come alive with colors, fonts, and movement.

The Scratch Community

The MADE Scratch Workshop
A Scratch programming workshop.

Scratch is used in many places: schools, museums, libraries, community centers, and homes. While it's designed for ages 8–16, people of all ages use it. This has led to many groups of Scratch users, both online and in person. In 2020, Scratch was even ranked among the top 20 programming languages in the world!

Learning with Scratch

Scratch is a great first language for learning to code. It's easy to make cool programs, and the skills you learn can help you with other languages like Python and Java.

Scratch isn't just for games. You can create animations, stories, music, and more. Teachers use Scratch to make lessons more visual and interactive. For example, they can create science labs with animations or quizzes for social studies. Using Scratch helps young people understand how programming works and how to be creative and work with others.

Scratch is taught in many schools and colleges around the world, including over 800 schools in India. It's even used in the first week of Harvard University's introductory computer science course, CS50.

Online Community for Scratchers

Jumper platformer
"Jumper", an example of a game created with Scratch 2.0.
Abyss scratch 3.0
"Abyss", an example of a game created with Scratch 3.0.

People who use Scratch are called 'Scratchers'. They can share their projects on the Scratch website and get feedback from others. You can upload your projects directly from the editor. Anyone in the community can see your code, learn from it, or even "remix" it to make something new.

Scratchers can also create "studios" for projects, comment on others' work, mark projects as favorites, and follow other members. Projects range from games to animations and useful tools. The website also has "Scratch Design Studio" challenges to encourage new creations.

The MIT Scratch Team works hard to make sure the online community is friendly and respectful for everyone. There's also a special online community for educators called ScratchEd, where teachers share ideas and resources.

The Scratch Wiki

The Scratch Wiki is a helpful resource for everything about Scratch. It has information about the website, its history, and how people use it. While the Scratch Team supports it, most of the articles are written by Scratch users themselves. It's a great place to find answers and learn more.

User Roles on Scratch

Every Scratch account has a role based on how much you use the platform. When you first create an account, you're a "New Scratcher". This role has a few limits, like not being able to use "Cloud Data" right away. After you've been active and shared some projects, you become a "Scratcher". This lifts most of the limits.

Official moderators and developers are part of the "Scratch Team". They usually have an asterisk (*) next to their username. There are also special accounts for Students and Educators, making Scratch useful for classrooms.

How Scratch is Built

The code for the Scratch editor and much of the website is available for anyone to see on GitHub. Scratch 3.0 is built using JavaScript. Scratch 2.0 used ActionScript, and the very first versions (1.X) were based on a language called Squeak.

Scratch 3.0 uses a special JavaScript library called Blockly, which was made by Google. Blockly helps create the block-based visual programming system that Scratch uses.

Events and Celebrations

Scratch Educators often meet in person at "Scratch Educator Meetups." Here, they share ideas and learn from each other about teaching with Scratch.

There's also an annual "Scratch Week" (formerly "Scratch Day") in May. People around the world host events, big or small, to celebrate Scratch. These events are listed on the Scratch Day website. Scratch Week also includes special activities on the Scratch website itself.

Every April Fools' Day, the Scratch Team likes to play fun pranks and add hidden surprises for users.

File Types in Scratch

Scratch projects are saved in special file formats.

  • In Scratch 1.4, projects were saved as *.sb files.
  • Scratch 2.0 uses *.sb2 files. These are like zip files that contain a .json file, plus all the sounds (as .wav files) and images (as .png files) used in the project.
  • Scratch 3.0 uses the *.sb3 format, which is very similar to .sb2, but handles sounds a bit differently.

Older Versions of Scratch

While the main Scratch website only runs Scratch 3.0, you can still download and use the offline editors for older versions like Scratch 2.0 and Scratch 1.4. Projects made in Scratch 2.0 can even be uploaded to the main website, where they are automatically changed into Scratch 3.0 format.

Technology Used in Older Versions

The editor for Scratch 1.4 was written in Squeak. The online player for Scratch 1.4 was first made with Java, and later with Adobe Flash. Scratch 2.0 relied on Adobe Flash for the online version and Adobe AIR for the offline editor. These technologies are not widely used anymore.

Interface of Older Versions

Scratch Hello World
A script that makes a sprite say "Hello, World!" and then stops in Scratch 2.0.

In Scratch 2.0, the stage area was on the left side. The programming blocks palette was in the middle, and the coding area was on the right. Extensions were found in a section called "More Blocks."

The blocks palette in Scratch 2.0 had different sections that you couldn't scroll between. Here's how they were organized:

Interface sections in Scratch 2.0
Category What it did
Motion Moved and changed the position of sprites.
Events Started code when something happened.
Looks Controlled how sprites looked.
Control Helped with decisions and repeating actions.
Sound Played sounds and music.
Sensing Allowed sprites to interact with other things.
Pen Drew on the stage.
Operators Performed math and comparisons.
Data Used for variables and lists.
More Blocks Contained custom functions.

Key Features of Scratch

Scratch uses event-driven programming, meaning code runs when specific events happen. It uses many active objects called sprites. You can draw sprites using a simple editor, or import them from other places. Scratch 3.0 supports one-dimensional lists and can handle numbers and text, but with limited ways to change text.

Scratch 2.0 had an experimental feature called the Extension Protocol. This allowed Scratch to connect with other programs and even hardware like Lego Mindstorms or Arduino.

Snap! (Build Your Own Blocks)

Snap! is a more advanced visual programming language that was inspired by Scratch. It was developed by Jens Mönig and Brian Harvey, who were both part of the Scratch Team. Snap! has more complex features, like being able to create your own types of functions and lists that can hold other lists. It's used to teach computer science courses to students who aren't majoring in computer science.

ScratchJr for Younger Kids

In 2014, ScratchJr was released for iPad, and later for Android. It's very similar to Scratch and was also co-led by Mitch Resnick. However, it's a completely new program designed for even younger children, usually aged 5 to 7.

Community-Made Changes

Because Scratch's code is open source, many people have created their own versions or additions to improve it.

  • Scratch Addons is a browser extension that adds many themes and helpful features to the Scratch editor and website.
  • Turbowarp is a special version of the Scratch 3.0 editor. It makes Scratch projects run much faster by changing the blocks into JavaScript code. Turbowarp can also turn your projects into standalone files for different devices.

Users can also create their own extensions for Scratch 3.0 using JavaScript. While the Scratch Team originally planned to allow this, they later decided against it due to safety concerns. However, some modified versions of the Scratch Engine still allow these custom JavaScript extensions.

Before Scratch 2.0, there were many other versions of Scratch created from the original Scratch 1.4 code. These usually added just a few extra blocks not found in the official version.

Images for kids

See also

  • Blockly, an interface used by Scratch to make the code blocks.
  • Snap! (programming language)
  • Swift Playgrounds
  • Alice (software)
  • Twine (software)
  • Lego Mindstorms EV3
  • Kodu Game Lab
  • Code.org
  • Programmable Cricket
  • PWCT
  • Visual programming language
  • Pencil Code (programming language)
  • Scratch Lab
kids search engine
Scratch (programming language) Facts for Kids. Kiddle Encyclopedia.