How to Make a Cloud Variable in Scratch: Step by Step

To make a cloud variable in Scratch, go to the Variables section in the block palette, click “Make a Variable,” and check the box labeled “Cloud variable (stored on server).” Cloud variables are special because they save data on Scratch’s servers and sync across users in real time, making them essential for things like high score boards and multiplayer interactions. There’s a catch, though: you need full Scratcher status before the cloud variable option appears.

Scratcher Status Comes First

If you just created your Scratch account, you’re classified as a “New Scratcher,” and the cloud variable checkbox won’t show up when you try to make a variable. Scratch requires you to earn full Scratcher status before you can use cloud variables.

To become a Scratcher, you need to be active on the platform for a few weeks, share several projects, and leave constructive comments in the community. There’s no exact number of projects or comments that triggers it. After enough activity, Scratch sends you a notification with an invitation to upgrade your status. If you haven’t received it yet, keep sharing projects, commenting helpfully on others’ work, and give it time. Once you accept the invitation on your profile page, cloud variables unlock immediately.

Step-by-Step: Creating a Cloud Variable

Once you have Scratcher status, creating a cloud variable takes about 10 seconds:

  • Open the Scratch editor and go to the “Variables” category in the block palette on the left side.
  • Click “Make a Variable.” A dialog box appears asking you to name the variable and choose its scope (for all sprites or this sprite only).
  • Check the box next to “Cloud variable (stored on server).”
  • Click OK. Your new variable appears in the palette with a cloud icon next to its name, and Scratch automatically adds a ☁ symbol to the variable’s label.

You can now use this variable with the standard “set” and “change” blocks, just like any other variable. The difference is that its value gets saved on Scratch’s servers and is visible to anyone who opens your project.

What Cloud Variables Can Store

Cloud variables only store numbers. You cannot save letters, words, or any other text in them. If you try to set a cloud variable to a string, the value simply won’t save. Each cloud variable can hold a number up to 256 digits long, or a negative number up to 255 digits. That’s far more than most projects need for scores or counters, but it’s worth knowing the ceiling exists.

Because of the numbers-only restriction, Scratchers who want to store text (like usernames for a leaderboard) use a common workaround: assign each letter of the alphabet a number (A = 01, B = 02, and so on), then encode the text as a long number and decode it when displaying. It takes extra blocks to set up, but it works reliably within the 256-digit limit.

Limits Per Project

Each Scratch project can have a maximum of 10 cloud variables. Regular variables have no practical cap, but cloud variables are limited because they constantly communicate with Scratch’s servers. For most use cases, like tracking a global high score or a few multiplayer positions, 10 is plenty. If your project idea needs more shared data, you’ll need to pack multiple values into a single cloud variable using encoding (for example, storing both a score and a player ID as one long number, then splitting them apart with math blocks).

Common Uses for Cloud Variables

The most popular use is a global high score. When a player finishes your game, a script checks whether their score is higher than the current cloud variable value. If it is, the variable updates, and every future visitor sees the new record. Because the data lives on the server, it persists even after the player closes the tab.

Multiplayer games are another common use. Two or more players visiting the same project at the same time can read and write to cloud variables, creating real-time interaction. One cloud variable might track Player 1’s x-position, another their y-position, and so on. With 10 cloud variables and some creative encoding, simple two-player games work surprisingly well.

Some Scratchers also use cloud variables as visit counters or voting systems. Each time someone opens the project, a script adds 1 to a cloud variable, giving a rough count of total visits.

Why Your Cloud Variable Isn’t Working

If you’ve created a cloud variable but it doesn’t seem to save, check these things. First, confirm you’re logged in. Cloud variables only update when the user is signed into a Scratch account. Second, make sure you’re running the project on the Scratch website, not in the offline editor. The offline editor doesn’t connect to Scratch’s servers, so cloud variables can’t sync. Third, verify you aren’t trying to store text. The variable will appear to accept a string inside the editor, but the value won’t persist or sync to other users. Finally, keep in mind that cloud variable updates aren’t instant. There’s a slight delay as data travels to and from the server, so rapid changes (like updating a position 30 times per second) may not all come through.