Decompile LUAC and LUB bytecode files back to readable Lua source code.
Drag and drop your .luac or .lub file or click to browse.
Lua bytecode is converted back to readable source code.
View the recovered Lua source code in your browser.
For Garry's Mod addons, use the GMA extractor to browse Lua, materials, models and sounds.
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.
Some engines pack every chunk into one container instead of shipping loose files. Solar2D and Corona SDK games keep the whole project in a resource.car archive of Lua 5.1 chunks — upload the APK or the archive itself to the Solar2D decompiler and it is unpacked before it reaches this decompiler. Cocos2d-x games encrypt theirs; see the Cocos decompiler.
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.
Lua 5.1, 5.2, 5.3 and 5.4 decompile, whether or not the chunk still carries its debug information — stripped chunks come back with generated variable names instead of the originals. Lua 5.0 is only readable when the chunk records a 32-bit instruction word, because 5.0 bytecode embeds the build's instruction and number sizes and a 64-bit build writes a format no decompiler reads. The version is detected from the header automatically, and a chunk that cannot be read comes with an explanation of which reason applies — an unsupported version, a word size from another machine, a patched Lua VM, a truncated file, or control flow the decompiler could not follow — rather than an empty file.