Online Lua Compiler
Write, run, and share code snippets — no setup required.
Run Lua online in your browser
A free online Lua playground and code runner. Write Lua scripts in your browser, hit Run, and the standard Lua interpreter executes them in seconds. No luarocks, no build, no local install to configure first.
The editor is built on the same engine as VS Code, so Lua syntax highlighting, autocompletion, and error squiggles all work. Code runs against the Lua interpreter on Alpine Linux, with the standard libraries available — string, table, math, io, os, and coroutine. Good for learning Lua for game scripting, embedded config, or Redis scripting.
What makes this Lua playground useful
- Instant Lua execution — write code, press Run, and see output from the Lua interpreter in seconds, no luarocks or build step needed.
- Full Lua syntax highlighting, autocompletion, and clear error messages with line numbers, powered by the same editor engine as VS Code.
- Stdin input is supported.
io.read(),io.read('*l'), andio.lines()all read from the playground's input box, so interactive Lua scripts behave the same as running them at the terminal. No Lua interpreter, luarocks, or build tools on your end. - Lua interpreter with tables, metatables, coroutines, and the standard string/math/io libraries — everything you need for scripting practice.
What you can build in the Lua playground
- Tables as arrays, records, and hash maps: the one composite type that makes Lua elegant, testable one assignment at a time.
- Metatables and metamethods (
__index,__newindex,__add,__call): the object-system building blocks you use in game scripting and embedded configs. - Quick Lua experiments: test a pattern-matching call with
string.match, verify a coroutine's yield/resume flow, or try a closure over an upvalue.
Online Lua compiler FAQ
Is the online Lua compiler free?
Do I need Lua or luarocks installed?
Does the Lua playground work on mobile and Chromebooks?
Does the Lua playground support io.read() and stdin?
io.read(), io.read('*l') for a single line, and io.lines() for iterating all read your typed lines the same way they would when you run lua script.lua at the terminal.