Try Pro IDE
Ln 1, Col 11:1
Run your code to see the output here Press F8 or Ctrl ↵. If your program asks for input, type it right here.

Online Lua Compiler

Run Lua scripts online with Lua 5.4. Write a script, press Run, and see what it prints beside your code, with errors shown with their line numbers. Scripts can read input with io.read as they run, and the standard string, table and math libraries are ready to use.

How to run Lua code online

  1. This page opens with Lua selected, so you can start typing straight away.
  2. Write your code in the editor, or open files from your computer: single files, or a whole project as a .zip.
  3. Press Run, or Ctrl+Enter. The output appears in the panel beside the editor, and when the program asks for input you type it there and press Enter.
  4. Share a copy with a link, or save your files to your computer.

Lua 5.4 on Online IDE

  • Scripts run with the lua5.4 interpreter, from top to bottom.
  • io.write prints without a new line and shows straight away, so a prompt appears before io.read("l") waits for a line.
  • tonumber turns text into a number, and returns nil when the text is not a number.
  • The standard libraries are available, such as string, table, math, io and os, but LuaRocks modules are not.

Example: a Lua program that reads input

io.write("How many rows? ")
local rows = math.tointeger(tonumber(io.read("l") or ""))

if not rows or rows < 1 then
  print("Please enter a whole number above zero.")
else
  for i = 1, rows do
    print(string.rep(" ", rows - i) .. string.rep("*", 2 * i - 1))
  end
end

Features of this tool

  • Simple and fastA clean, lightweight editor that opens instantly.
  • Powered by AceThe Ace code editor, with syntax highlighting, autocompletion and bracket matching.
  • Interactive programsType input into the terminal while your program runs.
  • Several filesWork in tabs, open files or a .zip from your computer, and save the project back to disk.
  • Made for learningHelpful for beginners to learn and practice programs.
  • Light and dark themesPlus 39 editor themes, a choice of coding fonts, and Vim, Emacs or VS Code keys.
  • Keep your outputCopy or download the program output in one click.
  • Share by linkSave your code in the cloud and open it anywhere.

Frequently asked questions

Which Lua version does Online IDE use?

Lua 5.4, run with the lua5.4 interpreter on Linux.

How does a Lua script read input?

Call io.read("l") to read a line you type in the output panel, or io.read("n") to read a number. Show a prompt first with io.write.

Can I use LuaRocks modules?

No. The standard libraries that come with Lua work, but LuaRocks modules are not installed and scripts cannot download them.

Can I run Roblox or LÖVE code?

Only the plain Lua parts. Roblox uses Luau, a dialect of Lua with additions such as type annotations, and LÖVE games need a window, so code that calls their functions does not run here.

Contact us

For any feedback, queries or issues, please feel free to contact us or write to . We value your input and are committed to providing the best possible experience for our users.

Download output

Delete file?

Its code will be deleted from the editor. Download it first if you want to keep a copy.

Switch language?

You have changed . Replace it with the starter program, or keep your code as it is?

Save to disk

Send feedbackRead by the people who build online-ide

How useful is online-ide for you?

Share your code

Anyone with the link can open a copy of every tab.

Link expires after

Your link is ready

Anyone with this link can open a copy of your code. It is also kept under , where you can revoke it.

Reset to starter code?

Save anything you want to keep first. This can't be undone.
  • Your changes to the code are removed
  • Extra tabs are closed
  • The editor goes back to the starter program

Files already open

Choose which open files to replace with the copies from disk. The rest stay as they are.

Save to browserKeep this project here to open it again later

Saved in this browser only. Clearing browsing data removes it, and it won't show up in other browsers or devices. For anything important, also save it to disk.

My projectsKept in this browser

    Projects and links are stored only in this browser, not in an account. They may be lost if you clear site data, reset or uninstall your browser, or if the browser evicts stored data. Private/incognito sessions use separate storage that is cleared when the session ends. Back up regularly.

    Help and shortcuts

    Online IDE is a web-based tool powered by the Ace code editor. Use it to learn, build, run and test your programs: open code from your computer, keep building here, and download the code and its output.

    Keyboard shortcuts

    Run or stop
    F8orCtrl↵
    Share code
    F9orCtrlH
    Save to disk
    F10orCtrlS
    Editor command palette
    F1
    Rename a tab
    Double-click it
    More file options
    Right-click a tab
    Jump to an error line
    Click it in the output

    Report a bug

    Found a bug or have an idea? Email us at .

    Data policy

    Your code is sent to the server only to run it and is cleared when it finishes. Shared code is kept until the expiry you choose.

    © 2026 online-ide.com

    Editor settingsSaved in this browser

    Layout

    Appearance

    Editing