Skip to content
Toolzy 100% free · no login

Home › Developer Tools › Online Lua Compiler

Online Lua Compiler

Runs in your browserFree · no sign-up

Write Lua and press Run. The official Lua 5.4 interpreter, compiled to WebAssembly, runs your script on your device and shows print() output below.

Ctrl + Enter runs the code. Tab indents; press Esc then Tab to move focus out of the editor.

Other languages: Python · JavaScript · SQL · HTML, CSS & JS playground

Advertisement

How to use this tool

  1. Type or paste a Lua script, or start from an example.
  2. Put any input in the Input box; io.read() returns one line per call.
  3. Press Run or Ctrl + Enter to execute it with Lua 5.4.
  4. Read the output, then share a link or download the .lua file.

The real Lua interpreter, in a web page

Lua is a small, fast scripting language used inside games and apps (Roblox's Luau, World of Warcraft add-ons, LÖVE, Neovim, Redis scripts and many embedded devices). This page runs the reference Lua 5.4 interpreter from PUC-Rio, compiled to WebAssembly through the wasmoon project and hosted on this site. Your script executes on your own device in a background worker, and print() and io.write() output appears in the panel below.

Language features

Everything in standard Lua 5.4 is available: tables as arrays and dictionaries, metatables and metamethods, closures, varargs, coroutines, integer and float subtypes, integer division with //, bitwise operators, the goto statement, and the string, table, math and utf8 libraries, including Lua patterns with string.find, gsub and gmatch. Errors include the line number, for example [string "..."]:3: attempt to index a nil value, so you can find mistakes quickly.

Input

Put input lines in the Input box. Each io.read() returns the next line, io.read("n") converts it to a number, and it returns nil when there is nothing left, which lets you write loops that read until the end of input.

Lua vs Luau (Roblox)

Roblox uses Luau, a dialect derived from Lua 5.1 with type annotations, compound assignment such as +=, and the Roblox API objects like game and workspace. Plain Lua logic, loops, tables and functions behave the same, so this is a good place to practise the language itself, but Roblox-specific objects and Luau-only syntax will produce errors here.

Limits and privacy

There is no file system or operating-system access, so io.open and os.execute do not work. Infinite loops are ended with Stop or by the time limit. Code is never uploaded; share links store it inside the address after the # sign.

Frequently asked questions

Which Lua version is this?

Lua 5.4, the official PUC-Rio interpreter compiled to WebAssembly.

Can I run Roblox scripts here?

Plain Lua logic works, but Roblox objects (game, workspace) and Luau-only syntax such as type annotations or += do not.

How do I read input?

Type it in the Input box. io.read() returns one line per call and nil at the end; io.read("n") returns a number.

Does it support coroutines and metatables?

Yes. The full Lua 5.4 language and standard libraries are available, except file and OS access.

Is it free?

Yes, free with no sign-up, and your code stays on your device.

More free tools