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

Commented, indented script → one dense line with no comments.
"Hello""\72\101\108\108\111" — same output, unreadable source.
Ship a plugin without exposing your logic and messages.

What the obfuscator does — and Lua string escapes

StepEffectReversible?
Strip commentsRemoves all -- line and --[[ ]] block commentsNo (comments are gone)
Minify whitespaceCollapses indentation and newlines to single spacesYes (re-formattable)
Encode stringsRewrites "text" as \ddd escape codesYes (decodable)

Lua string escape sequences

EscapeMeaning
\nNewline
\tTab
\" \'Quote characters
\\Backslash
\dddCharacter by decimal code (e.g. \72 = H)
\xNNCharacter by hex code (Lua 5.2+)
\zSkip 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?
Yes. It only removes comments and whitespace and rewrites strings using Lua's own escape syntax, so the program behaves identically. Keep a readable backup for your own maintenance, though.
Is obfuscation the same as encryption or protection?
No. Obfuscation makes code harder to read but is reversible — it deters casual copying, not a determined reverse-engineer. Don't hide passwords, API keys or secrets in client-side Lua, obfuscated or not.
What does 'encode string literals' do?
It converts the characters inside quoted strings to numeric escape codes, so readable text (messages, URLs, names) no longer appears in the source. The strings still produce the same values at runtime.
Does it rename variables?
This version focuses on comment removal, whitespace minification and string encoding, which are safe and never break code. Full variable renaming requires deeper analysis and risks breakage, so it's intentionally left out.
Is my code uploaded?
No — obfuscation runs entirely in your browser.
Can obfuscated Lua be reversed?
Yes, by a determined person — obfuscation is a deterrent, not encryption. Comments are gone for good, but minified code can be re-formatted and encoded strings can be decoded. Never hide secrets in client-side Lua.
Does string encoding change what the strings do?
No. \72\105 is exactly "Hi" to the Lua interpreter — the runtime values are identical, only the source text becomes unreadable.
Will it break code that uses long strings [[ ]]?
No. Long-bracket strings and long comments are detected and preserved (long strings are kept; long comments are removed) so the code stays valid.