Limitations of Scratch
Project (general)
- Title maximum length: 100 characters.
- project.json uncompressed file size limit: 5MB
- Individual asset (costume or sound) file size limit: 10MB
- There is no limit on sb3 file size.
- There is no limit on block count but due to the project.json size limit, expect that only 20000-30000 blocks can fit within it.
- Project framerate: 30FPS
- Threads have a time limit of 500ms. (encountered most often with custom blocks set to "run without screen refresh") Source code
- The numbers (not strings) Infinity, -Infinity, NaN, and -0 can not be saved in JSON.
- Scratch is mostly not case-sensitive. Notably sprite and costume names are case-sensitive.
Sprites
- Sprites are visually snapped to a grid sized with 480x360 steps on the screen.
- Size is limited by the current costume, when scaled it must not be visually larger than 150% the size of the stage (720x540) on any axis or smaller than 5 pixels on any axis. Source code
- Maximum number of clones at one time: 300 (limit shared by all sprites) Source code
- Sprites can not be positioned off-screen with a margin less than 15px still showing. Source code
- Clones do not have an accessible unique ID and there is no native way to identify or share data between them. You need to implement this yourself with variables and lists. Note that those set to "for this sprite only" will store values unique to every clone/sprite, useful for an ID.
Costumes/backdrops
- Accepted image file formats: PNG and JPG. Note that if an edit is made to a costume, that costume will be saved as a lossless PNG. GIFs may also be imported, each frame will be added as a costume.
- Bitmap maximum dimensions: 960x720 (using "half pixels").
- Vector costumes get rasterized to dimensions no more than 2048x2048. This results in very large vector costumes appearing blurry. Source code
Looks
- The color effect gives the sprite a minimum lightness and saturation. Source code
- The "fisheye", "whirl", and "pixelate" effects are always relative to the center of the costume.
- There is no "saturation" effect. Workarounds may involve multiple costumes or layering stamps or clones.
Control
- The "for each" loop compares the value in the repeat input every iteration. It is not stored. This is unlike the "repeat" loop which will repeat the number of times given initially. Source code
- "Stop all" will not immediately stop broadcasts that were just scheduled to run, they will run for 1 frame and may trigger other scripts that can run longer than that.
- "Stop other scripts in sprite" marks scheduled scripts to not run but will keep their order in the queue. They can still be reactivated within the same frame and will keep their order instead of being added to the end (and run last).
Sensing
- Touching color precision is limited to 5 bits red, 5 bits green, 4 bits blue. (this is only 14-bit color, much less than 24-bit RGB that is displayed by Scratch). Source code
- The keys that can be detected are here. Special keys such as shift, control, and backspace can not be detected.
- Left-click is the only mouse button that can be detected.
- The mouse position is clamped to the edge of the screen and rounded. Source code
- Multi-touch (for touch-screens) is not supported. There is only 1 mouse pointer.
- The timer only updates once per frame. For sub-frame timing, use the "days since 2000" block.
- For the touching color blocks, if there are more than 4000 pixels of the overlap in the touching area, the GPU will be used, which may affect performance and change its behavior. Source code
Events
- Broadcasts can only run once per frame.
- Broadcast receiver hats do not accept reporter blocks, the message selection is a field and you can only choose from the created messages.
Variables and lists
- Supported data types: booleans, double floats, strings. Through hacks it's possible to utilize a few other types such as arrays.
- List item limit: 200000 Source code
- There is no Scratch-imposed limit on string character count in variables and list items.
- Lists are 1-indexed. Item numbers count from 1.
- Neither variables or lists can be created at runtime, they must be created manually by the user. There is no way to place a reporter block in the variable or list name. Scratch also does not have dictionaries (or other similar collections).
- Variable and list monitors are always displayed in front of everything on the screen. They are also not visible in saved thumbnails.
Custom blocks
- Custom blocks are not shared across all sprites. There must be a definition in every sprite that needs it.
- Argument reporters are only usable within their own definition script and always return 0 when run outside it. This includes clicking to run.
- There is no return statement or reporter-shaped custom blocks. The typical workaround for returning a value is to set a variable in the custom block script. The "stop this script" block can be used to return early.
Cloud variables
- 10 cloud variables per project. Source code
- Setting the value of any cloud variable has a shared average rate limit of 10 times per second. Source code
- Variables may either store a floating point number (NaN and infinity excluded) or a string containing numerical digits 0-9, up to a length of 256 characters.
- Calculated from the above limits, the maximum data transfer rate is approximately 1063 bytes/sec.
- Users with "New Scratcher" status can not set cloud variables with values that other users can see.
Sound
- Accepted file formats: WAV and MP3. Stereo audio allowed. Note that if an edit is made to a sound, that sound will be saved as a mono WAV. It may be downsampled to 22.05kHz if over the 10MB file size limit. I recommend making edits in software other than Scratch so the file is always transferred to Scratch as MP3 (where necessary).
- Volume range: 0 to 100% Source code
- Pitch effect range: -360 to 360 Scratch Wiki
- Pan effect range: -100 to 100 Scratch Wiki
- Volume and effects are controlled per sprite/clone.
- Sounds played with the "play sound" block can only be stopped with the "stop all" and "stop all sounds" blocks, there is no way to stop an individual sound here. Sounds played with the "play sound until done" block can be stopped with "stop other scripts in sprite" or by deleting the clone if it was running in a clone.
- A sound can not be played multiple times simultaneously. All clones will be limited by this too. The sound may be duplicated in the sounds editor (or added to a different sprite) if playing it simultaneously is desired.
- The set/change volume and set/change effect blocks will cause a yield. Source code (volume) Source code (effect)
- There may be a slight delay when the sound is first played as it gets loaded.
- Sounds played with "play sound until done" are not guaranteed to loop seamlessly if played again immediately in a loop.
Pen extension
- The pen layer (internally called "skin") is in front of the stage but behind all sprites. Source code
- Pen layer dimensions: 480x360
- There is no way to erase a stroke or only part of the pen layer. There is only an "erase all" block.
- Pen "size" is its diameter in pixels and is limited to between 1 and 1200. Source code
- A pen size of exactly 1 or 3 offset the pen position to the top-right by 0.5 steps to be "pixel-aligned". Source code
- An ARGB color value with full transparency is not possible as the way the value is handled always ignores alpha. If converted to a number (e.g. from hexadecimal), the leading zeroes for alpha will be lost. If converted from a hex color code such as #FF3000, alpha handling isn't implemented. If setting pen color, it is suggested to either use the set pen transparency effect after setting the RGB color or ensure the ARGB value never uses an alpha of 0 (possibly clamp to 1). Otherwise, conditionally draw pen strokes.
- Every pen stroke is drawn independently of others; semi-transparent pixels from anti-aliasing or a semi-transparent pen color will be drawn visibly overlapping.
Music extension
- Duration in beats can only be between 0 and 100. Source code
- Tempo can only be between 20 and 500. Source code
- A maximum of 30 instrument sounds can be played simultaneously. Source code
Site
- Usernames can only be chosen with a length between 3 and 20 (inclusive). Characters are limited to the english alphabet (case insensitive), numbers 0-9, the underscore _ and dash -. Note that there are some usernames that do not fit these requirements, they may have been set by the Scratch Team or created before some requirements were made. Most of the invalid ones are not in use, see for example this topic of unusual usernames. Generally, users can not change their username.
Thanks to Vadik1 and Bambozzle for contributing some of the above items.