Lua Minifier
Paste Lua source code and strip comments and whitespace for a smaller, deployment-ready output.
Last updated: May 29, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Lua Minifier?
Lua Minifier removes all comment styles supported by Lua — single-line (-- comment), long comments (--[[ ... ]]), and level-bracketed long comments (--[=[ ... ]=]) — and then collapses whitespace to reduce file size. String literals and long strings ([[ ... ]]) are preserved verbatim. The output is functionally identical to the input but smaller, making it useful for embedding Lua in game engines, embedded systems, and web deployments where file size matters.
How to Use Lua Minifier
Paste Lua source code.
The minified output updates instantly.
Copy or download the minified .lua file.
Common Use Cases
- Reducing Lua script size before embedding in a game engine like Love2D or Defold.
- Minifying Lua configs before shipping in a microcontroller or IoT firmware.
- Stripping developer comments from Lua before distributing a mod or plugin.
- Preparing Lua for network transmission where payload size matters.
Example Input and Output
A Lua function with comments is minified.
-- Add two numbers
local function add(a, b)
return a + b
endlocal function add(a,b)
return a+b
endPrivacy
Lua code is processed locally in the browser and is not uploaded.

