Decompile LUAC and LUB bytecode files back to readable Lua source code.
Drag and drop your .luac or .lub file or click to browse.
unluac converts Lua bytecode back to source code.
View the recovered Lua source code in your browser.
Lua is a lightweight, high-performance scripting language designed for embedding in applications. Created in 1993 at PUC-Rio in Brazil, Lua is widely used in game development (World of Warcraft, Roblox, Garry's Mod), embedded systems, network tools (Nginx, HAProxy), and application scripting.
Lua's small footprint, fast execution, and simple C API make it the most popular embedded scripting language. Many games and applications use Lua for modding, configuration, and game logic scripting.
When Lua source code is compiled using the luac compiler, it produces a binary bytecode file (typically with a .luac extension). This bytecode runs directly on the Lua virtual machine without needing to parse the source text.
LUB files are functionally identical to LUAC files — they contain the same Lua bytecode. The LUB extension is an alternative convention used by some games and applications.
A compiled Lua file contains:
Lua bytecode is a register-based instruction set with relatively high-level operations. Unlike stack-based bytecodes (like Java's), Lua's register-based design preserves more information about how the original code was structured.
The decompiler analyzes the bytecode instructions, reconstructs control flow (if/else, for/while loops, repeat/until), identifies local variables from register usage, and generates equivalent Lua source code. String constants, number literals, and table constructors are directly recoverable from the bytecode.
Lua is the most widely used scripting language in the game industry. Many popular games use Lua for:
Games often distribute their Lua scripts in compiled form (.luac/.lub) to reduce load times and obscure the source code. This decompiler allows you to recover the original scripts for learning, modding, or analysis.
A LUAC file is precompiled Lua bytecode, created by the luac compiler. It contains bytecode that runs on the Lua VM without needing source code parsing. LUAC files are used to distribute scripts without exposing source code.
LUB is an alternative extension for compiled Lua bytecode files. It is functionally identical to LUAC. The LUB extension is commonly seen in game mods and embedded applications.
This tool uses unluac which supports Lua bytecode from versions 5.0, 5.1, 5.2, 5.3, and 5.4. The version is automatically detected from the bytecode header.