---
title: "decompile"
description: "Reads bytecode and submits it to the configured remote decompiler."
---

```lua
decompile(script: LocalScript | ModuleScript | Script): string
```

---

## Aliases

None.

---

## Arguments

<ParamField body="script" type="LocalScript | ModuleScript | Script" required>
  The script Instance to inspect.
</ParamField>

---

## Returns

<ResponseField name="source" type="string">
  The decompiled source or a commented diagnostic string.
</ResponseField>

Yields and sends Base64 bytecode to https://api.lua.expert/decompile. Failure may return a commented diagnostic string. A returned string is not a success guarantee. Remote service availability is not verified by these docs.

**Related types:** [Scripts types & behavior](/reference/scripts/types).

---

## Example

```lua
for _, script in ipairs(getscripts()) do
    if script:IsA("LocalScript") then
        local ok, source = pcall(decompile, script)
        print(ok, source)
        break
    end
end
```
