Swelıty
Tools for everyone

Free Online Lua Playground

Run Lua 5.3 code in your browser and see everything you print in a console. No install needed.

Press Run, or Ctrl or Cmd + Enter, to run your code. Everything you print shows in Console. This is Lua 5.3, run in your browser. io.write works, but io.read and files are not available.

main.lua

Preview

Console

Output appears here. Press Run, then try console.log("Hello")

How to use

  1. Write your Lua code in the main.lua tab.

  2. Press Run, or Ctrl or Cmd + Enter. Everything you print appears in the Console panel.

  3. Press Stop if your code never finishes.

  4. Copy the code, download a zip of your files or clear the editor with the icons above it.

  5. Open the full screen editor for more room, and use the A buttons to resize the text.

  6. Untick Wrap long lines to scroll sideways instead of wrapping.

Why use this tool

  • Lua 5.3

    Tables, metatables, closures, coroutines and the standard string, table and math libraries.

  • Built-in console

    Output from print and io.write appears beside the preview, and errors come with line numbers.

  • Runs in your browser

    Nothing to install: the code runs in your browser.

  • Isolated preview

    Your code runs in an isolated frame, so it cannot reach this site or your other tabs.

  • Comfortable editor

    Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.

About this tool

Run Lua 5.3 in your browser with nothing to install. Write your program in the main.lua tab, press Run, and read what it prints in the console. Strings, tables, math, metatables, closures and coroutines all work, so you can learn the language, try a script for a game or a tool, or check a function before it goes into your project. Lua is run by Fengari, a Lua engine written in JavaScript. Keyboard input and file access are not available in a browser.

Frequently asked questions

Lua 5.3, run by Fengari, a Lua engine written in JavaScript. It is loaded from a public CDN and verified with an integrity check.

No. There is no keyboard input, so io.read does not work. Put your test data in the code.

No, packages cannot be installed here, but the standard library is available.

Yes, the first time you press Run, because the Lua engine is fetched from a public CDN.

Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.