Skip to content

Luau minifier

Paste a script to remove comments and whitespace. Strings, long brackets and Luau syntax are read as tokens, so nothing inside them is touched.

0 renames variable names stay readable in errors · Checked October 16, 2026

373 → 291 bytes · 22% smaller

Minified
How it works

What it removes

  • Line comments (-- like this) and block comments (--[[ like this ]]).
  • Blank lines and indentation.
  • Spaces that the parser does not need, such as around operators and brackets.

It keeps every string exactly, including long strings like [==[ ... ]==], and it never renames variables. Error messages from a minified script still point to names you recognise.

When minifying helps

Roblox does not run scripts faster because they are shorter. Minifying is useful when size matters: a loadstring payload, a script stored in a StringValue or DataStore, a module pasted into a chat or a plugin you ship as one file. For code you keep working on, use the formatter instead.

Questions

Does minifying make my game faster?

No. Luau compiles scripts to bytecode before running them, so whitespace and comments make no difference at runtime.

Can it break my script?

The minifier works on tokens, not text patterns, so strings and comments are recognised correctly. It also keeps a newline wherever removing it could change meaning, such as before a line that starts with a parenthesis.

Does it obfuscate code?

No. Names are not changed and the code is still readable once formatted again.