WebToolsPlanet
Developer Tools

Lua Minifier

Paste Lua source code and strip comments and whitespace for a smaller, deployment-ready output.

Last updated: May 29, 2026

Client-Side Processing
Input Data Stays on Device
Instant Local Execution

Find this tool useful? Support the project to keep it free!

Buy me a coffee

What 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

1

Paste Lua source code.

2

The minified output updates instantly.

3

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.

Lua with comments
-- Add two numbers
local function add(a, b)
    return a + b
end
Minified Lua
local function add(a,b)
return a+b
end

Privacy

Lua code is processed locally in the browser and is not uploaded.

Frequently Asked Questions

Will minified Lua still run correctly?
Yes. Comment removal and whitespace collapsing are safe transformations that do not affect Lua runtime behavior.
Does it handle nested long brackets?
Yes. Long strings [[ ]] and level-bracketed forms [=[ ]=], [==[ ]==] are preserved correctly and not treated as comments.
Is my code uploaded anywhere?
No. Minification runs entirely in your browser.