Welcome to HCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Welcome to HCODX Online Compiler
Quick Start:
Ctrl+Enter Run code
Ctrl+S Save / Download
Ctrl+L Clear output
Select a language and start coding.
Compile and run Lua code online instantly with HCODX. Our free cloud-based Lua compiler supports real-time execution, standard input, syntax highlighting, and code download. No installation or configuration required. Start coding in Lua now.
Run Lua instantly without installing any IDEs or configuring environments. Our cloud-based Lua handles libraries, runtimes, and dependencies automatically so you can focus on writing code.
Whether you are studying algorithms in Lua, practicing data structures in Lua, or exploring functional programming, our tool provides real-time stdout/stderr feedback with interactive standard input support.
HCODX is a free online compiler and code runner: write code in your browser, execute it on a cloud sandbox, and interact with your program through a live terminal. Students use it for coursework and interview practice; developers use it to test snippets in 85+ languages without setting up a local environment.
Weighing in at well under a megabyte, Lua proves how much power fits in a tiny interpreter. Born in 1993 at PUC-Rio in Brazil, it has become the de facto embedded scripting language: Roblox (via its Luau dialect), World of Warcraft addons, Neovim configuration, Redis scripting, and Cloudflare's edge (through OpenResty/nginx) all speak Lua. The current release line is Lua 5.4, which added integer division semantics, const/close variables, and a generational garbage collector. The language itself is minimal — tables are its single data structure, and metatables plus coroutines provide the rest. Here you get a live Lua 5.4 terminal in your browser: run scripts instantly and answer io.read() prompts as they appear.
io.write("Enter your name: ")
local name = io.read("l")
io.write("How many Fibonacci numbers? ")
local count = tonumber(io.read("l")) or 10
-- a closure-based generator, classic Lua
local function fib_gen()
local a, b = 0, 1
return function()
a, b = b, a + b
return a
end
end
local next_fib = fib_gen()
print("Hello, " .. name .. "! Here are your numbers:")
for i = 1, count do
io.write(next_fib(), " ")
end
print()
Lua is the fastest route into game scripting: Roblox creators, WoW addon authors, and LÖVE2D hobbyists all need core Lua fluency before touching engine APIs, and this page is a clean place to drill tables, closures, and metatables without a game engine in the way. It is equally relevant for DevOps engineers writing Redis EVAL scripts or nginx/OpenResty handlers, and for Neovim users prototyping config logic. Because embedded environments often restrict which libraries exist, practicing against plain standard-library Lua mirrors real deployment conditions surprisingly well. HCODX is a free online Lua editor, runner and interpreter — an IDE-grade compiler and playground to write and run code online, execute code with live output and live preview, no downloads or web server required.
Yes. io.read() blocks the running program until you type a line into the terminal, just like running lua from a local shell. Because output streams live, an io.write prompt appears first and your typed response is consumed immediately — you can chain as many prompts as your script needs.
This is standard PUC-Rio Lua from the 5.4 line — the reference implementation. Luau (Roblox) and LuaJIT (5.1-based) are dialects with their own extensions, but core syntax, tables, closures, and coroutines are shared, so almost everything you practice here transfers directly to those environments.
No, the sandbox has no package manager — you get Lua's built-in libraries: string, table, math, io, os, and coroutine. That is intentional parity with embedded Lua, where host applications typically expose only the standard library plus their own API, so standard-library fluency is exactly the skill worth building.
Your current code will be replaced with the default sample. This cannot be undone — download your code first if you want to keep it.
You have unsaved changes. Do you want to save your code before continuing?