Lua Obfuscator & Minifier
Strip comments, minify whitespace and encode string literals to make Lua scripts harder to read — all in your browser.
Lua Obfuscator
Obfuscation deters casual reading; it is not encryption and can be reversed by a determined person. Keep an unobfuscated backup.
🔒 Nothing you enter is sent anywhere or stored. All processing happens in your browser.
How it works
This tool makes Lua scripts harder to read at a glance by doing three things: it strips all comments, minifies whitespace (indentation and blank lines collapse away), and optionally encodes every string literal into numeric escape sequences (\104\105 instead of "hi"), so readable text and messages disappear from the source.
The result runs identically to the original — the escaping uses Lua's own string escape syntax, and only whitespace and comments are removed, never anything the code needs. It's useful for shipping game scripts, plugins, or Roblox code where you'd rather people not casually copy or read your logic.
Be clear-eyed about what obfuscation is: a deterrent, not security. A determined person with a de-obfuscator or patience can reverse it, so never rely on it to hide secrets, and always keep an unobfuscated backup. Everything runs in your browser — your code is never uploaded.
Examples
What the obfuscator does — and Lua string escapes
| Step | Effect | Reversible? |
|---|---|---|
| Strip comments | Removes all -- line and --[[ ]] block comments | No (comments are gone) |
| Minify whitespace | Collapses indentation and newlines to single spaces | Yes (re-formattable) |
| Encode strings | Rewrites "text" as \ddd escape codes | Yes (decodable) |
Lua string escape sequences
| Escape | Meaning |
|---|---|
| \n | Newline |
| \t | Tab |
| \" \' | Quote characters |
| \\ | Backslash |
| \ddd | Character by decimal code (e.g. \72 = H) |
| \xNN | Character by hex code (Lua 5.2+) |
| \z | Skip following whitespace (Lua 5.2+) |
The obfuscator uses the \ddd form, which every Lua version understands, so encoded strings run everywhere the original would.
Frequently asked questions
Will the obfuscated code still run the same?
Is obfuscation the same as encryption or protection?
What does 'encode string literals' do?
Does it rename variables?
Is my code uploaded?
Can obfuscated Lua be reversed?
Does string encoding change what the strings do?
\72\105 is exactly "Hi" to the Lua interpreter — the runtime values are identical, only the source text becomes unreadable.