Why convert LUA to LUAC?
Distributing scripts as bytecode removes the parse overhead on each load and prevents casual reading of the source code. The .luac format is Lua's native compiled bytecode representation, produced directly by the standard Lua toolchain that ships with every Lua installation.
How to convert LUA to LUAC
luac FREE
Run luac -o script.luac script.lua in a terminal. Add -s to strip debug info for a smaller file, or list multiple .lua files to compile them into a single bytecode chunk.
LuaJIT FREE
Run luajit -b script.lua script.luac to compile to LuaJIT's own bytecode format. Note that LuaJIT bytecode is incompatible with the standard Lua VM.
About these formats
A LUA file is source code written in Lua, a lightweight scripting language created in 1993. Any code editor (VS Code, Notepad++) opens it for reading or editing. To run it you need the Lua…
Open .LUA details →A .LUAC file is associated with Lua Compiled Source Code, a developer file.
Open .LUAC details →Quality & what to watch
- A
.luacfile is tied to the exact Lua version that compiled it; bytecode fromluac 5.4will be rejected by Lua 5.3 or earlier. - Bytecode is not encrypted - tools such as
unluaccan partially decompile.luacfiles. Do not rely on it to protect sensitive logic. - The bytecode format is platform-specific; a
.luaccompiled on a 64-bit machine may fail on a 32-bit device. Compile on the same platform that will run it.
Frequently asked questions
Is luac already installed if I have Lua?
luac ships with the official Lua distribution and requires no separate download.Will the .luac file run faster than the original .lua?
Can I recover the original .lua source from a .luac file?
-s to luac strips even line numbers and function names, making recovery harder.Does LuaJIT use the same bytecode format as standard Lua?
luajit -b only when the target also runs LuaJIT.