luau
We turn Luau bytecode back into source. Where we can't be sure of something, we mark the spot or refuse that function instead of guessing.
what it reads
| you have | what happens |
|---|---|
| Luau bytecode | These files are compiled modules from the standard Luau compiler in bytecode versions 1 to 14, at any optimisation and debug level. |
| older formats | The decompiler removes the RSB1 compressed wrapper before reading the module, and handles the pre-release version 1 format. |
.rbxl and .rbxm files | You open them in your browser, binary or XML (.rbxlx, .rbxmx). Only their scripts' bytecode gets sent, and you download a copy with the decompiled scripts. |
In an executor, the executor client gets each script's bytecode for you. Other Lua versions aren't read yet: see lua versions.
what you get back
Here are the instructions for one function, as the bytecode holds them:
; function onLeave(player)
GETUPVAL R1 0
LOADNIL R2
SETTABLE R2 R1 R0
RETURN R0 1Here is the source the decompiler gives back for it, which compiles to those same instructions:
local function onLeave(player) sessions[player] = nil end
Names come from the module's debug information where it kept them. Where it didn't, the default output uses numbered names such as v0 for locals and arg0 for parameters, or a name taken from what it certainly holds. It never invents a name that sounds right but might mislead you. The Model names switch (modelNames), on in the balanced and readable presets and on the site by default, asks a model to name the rest: easier to read, but those names are its guesses about what values mean, not facts from the file. They never change what the program does.
how sure it is
Every change to the decompiler is tested on hundreds of Luau modules, each compiled at every optimisation level. Nearly all must decompile to source that compiles back to identical bytecode, and every one must run the same as the original.
Your own file isn't recompiled or run when you decompile it, so every result comes with a verdict on how far to trust it, and points at any spot that was marked or function that was refused. What changed recently is on the changelog.
Today's Luau compiler can't write bytecode versions 1 and 2 or the pre-release format, so source decompiled from them can never compile back to the same bytes. For those, the decompiler aims for the same program.
try it
Drop a compiled module or a .rbxl/.rbxm on the home page. You get 100 free decompiles a day. Scripts and agents can use the same decompiler through the API.