Obfuscate your Luau.
Ship with confidence.

lhex is an obfuscator for Luau, built for Roblox. It applies control-flow flattening, string encryption, and VM virtualization to your scripts without altering their behavior or adding meaningful runtime overhead.

It was written for Luau specifically, not ported from a Lua toolchain. The transformations account for Luau's type system, syntax, and how the Roblox runtime evaluates code.

What it does

Each pass targets a specific way source code is recovered after the fact. They stack, and each one is tuned for how Luau compiles.

Control-flow flattening

Branches, loops, and early returns are rewritten into a state machine driven by a dispatch loop. Decompilers that expect straight-line structure lose the original ordering. The emitted code computes the same result.

String encryption

String literals are encrypted at build time and decrypted at the point of use. Constant scanners and quick dumps return ciphertext. Equality checks against literals in your source still resolve correctly at runtime.

VM virtualization

Selected functions are compiled to a custom bytecode and run inside an embedded interpreter. The original Luau body never reaches the client in any readable form, and the interpreter has its own opcode set per build.

Build times

Typical scripts finish in under two seconds. Passes run in parallel where they can, and the output is deterministic for a given input, which makes caching and diffing practical.

Luau coverage

Type annotations, generalized iteration, string interpolation, and other Luau-specific constructs are parsed and transformed correctly. Nothing has to be stripped or rewritten before obfuscation.

Behavioral parity

The output runs the same code paths and produces the same results as the input. The goal is to make the source unreadable, not to change what it does or how fast it does it.

How it works

Two steps. There is no local tooling or configuration required.

1

Submit your source

Upload a .luau or .lua file, or paste source into the dashboard. Multi-file projects can be submitted together and are resolved in order.

2

Retrieve the output

The obfuscated file is ready in seconds. It is a drop-in replacement for the original — same entry point, same API surface, same behavior.

Get started

Create an account to obfuscate scripts, or check pricing to see plans and licensing.