Lua · online compiler

Run Lua online

Run Lua online — 5.1, 5.3, 5.4. Tiny, embeddable, browser-hosted.

Available versions
Firecracker microVM live per-test verdicts multi-file compile

Lua is a tiny, embeddable scripting language — under 300KB compiled — that has ended up inside your game engine, your NGINX plugin, your Redis scripts, your Wireshark dissectors, and (via LuaJIT) some very fast production systems.

ls-judge runs Lua with the reference `lua` interpreter. Choose 5.1 (LuaJIT-compatible), 5.3, or 5.4 (the latest, with integer subtype).

Starter code

What you get in Lua

Clicking "Run now" opens the playground with this exact code and a matching test case pre-loaded — passes on first Run.

lua
Lua 5.4
local n = tonumber(io.read())
print(n * 2)
stdin →21
expected →42
FAQ

Common questions about Lua on ls-judge

LuaJIT?
LuaJIT is 5.1-compatible; picking 5.1 gives you the reference PUC-Lua 5.1, not LuaJIT.
LuaRocks packages?
No — no network in the sandbox.
What version is closest to WoW / Nginx OpenResty?
5.1 — those hosts embed a 5.1-compatible interpreter.
Free?
Yes.
Further reading
Also try