Online Lua Compiler

Run Lua 5.3 online in your browser. print, tables, closures and io.read supported. Free, instant, no install.

πŸ”’ Code never leaves your browser⚑ Real compilerπŸ†“ Free, no install

How to use Online Lua Compiler

  1. Type or paste your program into the editor, or pick one from the Examples list.
  2. If the program reads input, type it in the Input box, one value per line.
  3. Press Run (or Ctrl+Enter). The output appears under the editor, together with the run time.
  4. Use Stop if a program never ends. Use Copy code or Download to keep your work.

What is it good for?

Run Lua 5.3 online in your browser. print, tables, closures and io.read supported. Free, instant, no install.

Nothing has to be installed or configured. The language runs inside your browser, so it is a quick way to test an idea, finish homework or practise for an interview on any device. People most often reach for it when learning a new language from a phone or a borrowed computer, finishing a programming assignment without installing a compiler and checking how a language feature behaves in a particular standard.

See it in action

Here is a small program and what it prints.

Lua codeprint("Hello, World!")
OutputHello, World!
Good to know. Use io.read() for input from the Input box. The os and io file functions are not available in the browser.

About Lua

Lua is a tiny, fast scripting language used in games (Roblox, Love2D), embedded devices and tools. Tables are its one data structure and do the job of arrays, maps and objects.

This online Lua compiler uses Fengari, a complete Lua 5.3 virtual machine written in JavaScript, so tables, metatables, closures, coroutines and string patterns work as expected.

Use print for output and io.read() for input. File and operating-system functions are not available inside the browser sandbox.

What works and what does not

  • Runs in your browser, with no sign-up and no limit on runs.
  • Your code and input stay on your device.
  • No network access and no files outside the program itself.
  • Press Stop to end a program that loops forever.

More example programs

Tables and loops

Codelocal fruits = {"apple", "banana", "cherry"} for i, f in ipairs(fruits) do print(i, f) end local sq = {} for i = 1, 5 do sq[#sq + 1] = i * i end print(table.concat(sq, ", "))
Output1 apple 2 banana 3 cherry 1, 4, 9, 16, 25

Read input

Codelocal name = io.read() local n = io.read("n") print("Hi " .. name .. ", " .. n .. " times 3 is " .. n * 3)
InputDev 4
OutputHi Dev, 4 times 3 is 12

Closures

Codelocal function counter() local c = 0 return function() c = c + 1; return c end end local next = counter() print(next(), next(), next())
Output1 2 3

Other online compilers

Online C Compiler, Online C99 Compiler, Online C11 Compiler, Online C17 Compiler, Online C23 Compiler, Online C++ Compiler, Online C++11 Compiler, Online C++14 Compiler, Online C++17 Compiler, Online C++20 Compiler, Online C++23 Compiler, Online Python Compiler.

Using it day to day

The layout adjusts to phones and tablets, so you can use it on whichever device is handy.

Use the copy and download buttons where they appear. They save you from selecting text by hand, which is easy to get wrong on a phone.

Privacy

Your program is compiled and run inside your browser. The code and its input are never uploaded to a server.

Frequently asked questions

Is Online Lua Compiler free to use?

Yes, completely free. There is no sign-up, no watermark and no limit on how many times you use it.

Is my data safe when I use Online Lua Compiler?

Your program is compiled and run inside your browser. The code and its input are never uploaded to a server.

Does Online Lua Compiler need to be installed?

No. It runs entirely in your browser using WebAssembly or JavaScript. The first run of some languages downloads the engine once and your browser keeps it for next time.

Can I give input to my program?

Yes. Type the input in the Input box, one value per line, and read it the normal way for the language (for example scanf, cin, input() or gets).

Why does it not support Java, Go or Rust?

Those compilers are too large or too dependent on a server to run inside a web page without sending your code elsewhere. This page only lists languages that can run fully in your browser, so your code stays private.

Does Online Lua Compiler work on my phone?

Yes, but a keyboard makes coding easier. C and C++ need about 100 MB of free memory the first time the compiler loads, so older phones may be slow.

Any tips for using Online Lua Compiler?

Use io.read() for input from the Input box. The os and io file functions are not available in the browser.