Online Lua Compiler
Write, run, and share code snippets — no setup required.
Run Lua online in your browser
This is a free online Lua playground and code runner. Write Lua scripts directly in your browser, hit Run, and execute with the standard Lua interpreter in seconds — no luarocks, no build, no local install required. It's the fastest way to try a table trick, test a metatable, or work through a Lua scripting exercise.
Under the hood, the editor uses the same engine as VS Code (Lua syntax highlighting, autocompletion, error squiggles), and your code runs against the Lua interpreter on Alpine Linux with the standard libraries available — string, table, math, io, os, and coroutine. Whether you're learning Lua for game scripting, embedded config, or Redis scripting, this online Lua compiler goes from idea to output in seconds.
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 — the same editor engine that powers VS Code.
- Stdin input supported —
io.read(),io.read('*l'), andio.lines()all read from the playground's input box, so interactive Lua scripts work exactly like running them at the terminal. No install — no Lua interpreter, luarocks, or build tools. - 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.