Free tool for Roblox creators
Luau playground: run Luau in your browser
A Luau playground runs Luau, the language Roblox games are scripted in, without opening Roblox Studio. Write code, press Run, see what it prints, and check its types with the same type checker Studio uses.
Luau playground
Official Luau engineTab indents; press Escape, then Tab, to leave the editor. Runs stop after 5 seconds. Your code stays in this browser, and a shared link carries it in the part after # that is never sent to our server.
- The official Luau engine
- Strict type checking
- No login; nothing leaves your browser
The short answer
This playground runs standard Luau: variables, tables, functions, strings, math, types and errors behave exactly as in a Roblox script. What it does not have is Roblox itself: game, workspace, Instance, task and the services exist only inside Roblox, so code that uses them needs Roblox Studio. Use the playground to learn the language, try an idea or test a function before you put it in a game.
Engine built from the official Luau source on 21 October 2026.
What runs here
Luau here and in Roblox Studio
The language is the same. The world around it is not.
| Feature | This playground | Roblox Studio |
|---|---|---|
| Variables, tables, loops, functions | Yes | Yes |
string, table, math, buffer, bit32, utf8 | Yes | Yes |
Type annotations and --!strict | Yes, with Check types | Yes, in Script Analysis |
String interpolation, +=, continue, generalized for | Yes | Yes |
pcall, error, coroutines | Yes | Yes |
game, workspace, Instance, Vector3, CFrame | No | Yes |
task.wait, wait, events | No | Yes |
| Services such as Players or DataStoreService | No | Yes |
Code that calls Roblox APIs fails here with attempt to index nil, because those globals do not exist outside Roblox. For that code, use Roblox Studio, which is free.
Learn Luau
Five things to try first
- Print and loop. The Hello and loops example shows
printand a numericforloop. Change the numbers and run it again. - Tables. Tables are Luau's only data structure: lists, dictionaries and objects. Tables and sorting sorts players by score.
- Functions and closures. Functions and a cooldown builds the cooldown check almost every Roblox attack or pickup script needs.
- Types. Load Types (with a mistake) and press Check types. The checker finds the wrong price before the code ever runs.
- Errors. Errors and pcall reproduces
attempt to index nil, the most common Roblox script error, and catches it withpcall. The script errors guide explains how to fix it in a game.
FAQ
Luau playground questions
What is Luau?
Luau is the programming language Roblox games are scripted in. It started as Lua 5.1 and Roblox has added types, string interpolation, compound assignment such as +=, faster performance and more. It is open source.
Is Luau the same as Lua?
Luau is based on Lua 5.1 and most Lua 5.1 code runs in it, but it adds features Lua does not have, such as type annotations and string interpolation, and removes a few unsafe ones. Code written for newer Lua versions may not run.
Can I run Roblox scripts here?
Only the plain Luau parts. game, workspace, Instance, task and the services exist only inside Roblox, so a script that uses them needs Roblox Studio, which is free.
Is my code saved or sent anywhere?
Your code stays in your browser: the page keeps a draft on your device, and a shared link carries the code after the # sign, which browsers never send to the server. Nothing you write is uploaded.
Why did my script stop after 5 seconds?
The playground stops any run that takes longer than 5 seconds, which is almost always an endless loop. Roblox stops a script that never yields too, with the error Script timeout: exhausted allowed execution time.
Does Check types match Roblox Studio?
It uses Luau's own type checker in strict mode, the same checker behind Studio's Script Analysis. Studio also knows Roblox's API, so it checks calls such as workspace:FindFirstChild that this page cannot.
From practice to a game
Turn your Luau into a working game
When your idea needs players, parts and the rest of Roblox, it belongs in Studio. RoCode, an independent AI agent for Roblox Studio, writes the scripts in the place you have open.
Free credits every day, no card. Prefer to learn by hand? Start with scripting for beginners.
Share
Link to this playground
Free to use in a DevForum post, a tutorial or your own site.
<a href="https://www.rocode.app/tools/luau-playground">Luau playground by RoCode</a>
Sources and credits
- luau-lang/luau (opens in a new tab), the official Luau source (MIT License, Copyright Roblox Corporation and Lua.org, PUC-Rio). This page runs its web build, compiled with Emscripten from commit 6d36d48 on 21 October 2026.
- luau.org (opens in a new tab), the Luau language site: syntax, the type checker and the standard library.
- Roblox Creator Docs: Luau (opens in a new tab), how Luau is used in Roblox and the Roblox API it adds.
RoCode is an independent product, not made by Roblox. The Luau engine on this page is unmodified; the page around it is RoCode's.