Lua Minifier
Compress your Lua code by removing whitespace, comments, and formatting instantly.
Minified output will appear here...About Lua Minifier
Lua scripts used in game engines, embedded systems, and configuration files are often written with comments, generous spacing, and indentation for readability. When deploying Lua scripts to production — especially in resource-constrained environments like game mods or IoT devices — reducing file size matters. Lua Minifier removes every line comment, every block comment, and all unnecessary whitespace from your code, compacting it into the smallest valid single-line form that executes identically to the original.
Common scenarios where this tool pays off include shipping Roblox or Luau scripts under size limits, trimming WoW or FFXIV addon files before packaging, reducing overhead in Love2D game builds, and cleaning up embedded Lua modules in firmware images or NGINX configurations. Because Lua ignores whitespace outside string literals, the compact output runs byte-for-byte equivalently while cutting file size by 20–60% for typical scripts with moderate documentation.
All minification runs entirely inside your browser using JavaScript. Your source code is never uploaded, stored, or transmitted to any server — making this tool safe for proprietary game code, internal tooling, and client work under NDA. There are no file size limits, no accounts required, and no cost.
Key Features
Removes both comment styles
Strips single-line comments starting with -- and multi-line block comments wrapped in --[[ ... ]], leaving no comment artifacts in the output.
Collapses all whitespace
Newlines, tabs, and runs of spaces are folded into a single space, producing compact single-line output without breaking operator spacing or string literals.
100% client-side processing
Minification runs in your browser. Your Lua source never leaves your device — safe for proprietary game scripts, licensed addons, and confidential firmware code.
Live size savings report
After minification, a stats bar shows the original character count, minified character count, and the exact percentage saved so you can confirm the reduction.
File upload and download
Load .lua or .txt files directly from disk and download the minified result as minified.lua — no copy-paste needed for large scripts.
Works with Luau and Lua variants
Handles standard Lua 5.x syntax used in Roblox Luau, Love2D, NGINX, WoW addons, and embedded environments without requiring version-specific configuration.
How to Use
Paste Your Lua Code
Copy your formatted Lua script and paste it into the input editor on the left.
Minify
Click "Minify" to strip all comments and whitespace from your Lua code.
Copy the Result
Review the size savings, then copy the minified Lua or download it as a .lua file.
Example
Line comments, block comments, indentation, and blank lines are all removed. The remaining code is collapsed into a single compact line.
--[[
Greet a player by name.
Returns a greeting string.
]]
local function greet(name)
-- Build the message
local msg = "Hello, " .. name .. "!"
return msg
end
print(greet("World")) local function greet(name) local msg = "Hello, " .. name .. "!" return msg end print(greet("World")) Common Use Cases
- arrow_circle_right
Roblox and Luau script size reduction
Roblox enforces script size limits and charges bandwidth for place files. Minifying Luau modules and LocalScripts before publishing reduces place file size and speeds up client loading without touching any game logic.
- arrow_circle_right
WoW and FFXIV addon packaging
World of Warcraft and Final Fantasy XIV addons are distributed as file bundles where every kilobyte counts. Stripping developer comments and formatting before release keeps the downloadable package lean without maintaining a separate build pipeline.
- arrow_circle_right
Embedded Lua in firmware and IoT devices
Microcontrollers running NodeMCU, ESP8266, or similar Lua-capable firmware have tight flash storage budgets. Minifying scripts before flashing them lowers memory footprint and can be the difference between fitting or not fitting the module.
- arrow_circle_right
NGINX and OpenResty Lua modules
Lua blocks embedded in NGINX configuration via ngx_lua or OpenResty are loaded on every worker start. Removing comments and excess whitespace from long filter or auth scripts trims parse time and reduces the config footprint.
- arrow_circle_right
Love2D and game jam builds
Love2D games are distributed as .love zip archives. Minifying all Lua source files before packing the archive cuts download size for players and speeds up the initial require chain on slower machines.