We use cookies.This website uses essential cookies to operate core features. With your consent, we also use analytics cookies to understand traffic and improve the service. For more details, see our .
Was this tool helpful to use?
Your feedback helps us make it better

Trim comments and whitespace from Lua source, compare the before-and-after text length, and copy the compact result for review.
The minified result will appear here after you enter Lua code
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
Lua minification removes comments and excess whitespace so source is easier to copy or compare. Paste text to see the compact result, input and output lengths, and reduction percentage. You can copy it. This is source cleanup, not bytecode compilation, encryption, or variable renaming.
The text rules are not a full Lua parser. Strings, long comments, escapes, and adjacent operators can be affected. Review the output; equivalence is not compiler-certified.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Save the original, then paste a Lua snippet. Note the Lua version and host APIs it requires.
Check the output and reduction. Measurements use JavaScript string length, not UTF-8 file bytes or packaged size; shorter text does not prove faster execution.
Inspect strings, long strings, table constructors, concatenation, operators, and comment boundaries. Parse with your project's Lua compiler or interpreter and run relevant tests.
Use the result only after checks pass. Restore the original if parsing or behavior changes, then use a Lua-aware minifier or edit formatting manually.
Use cases
See how the tool fits into real work and everyday tasks.
Developers can shorten a small configuration or example and compare it with a readable version. A compact snippet may fit a tutorial or support field; keep a commented copy for maintenance.
Before embedding Lua in another language or a command-line argument, check that container's escaping rules. This page does not escape JSON, HTML, shell, or SQL, or validate host-specific APIs. Use your build pipeline and tests for production code.
Q&A
Find concise answers to common questions and confusing cases.
No. Text rules do not parse all Lua syntax. Compile with the target version and test before adopting the output.
No. It compares JavaScript string lengths. UTF-8, gzip, transport, and packaging each affect actual size.
No. Comments and whitespace are removed, while names, strings, and structure can remain readable.
A simple matcher may confuse string contents with comments. Check complex literals carefully or leave them unchanged.
Notes
Review scope, result limitations, and important precautions before use.
This quick cleanup does not replace a syntax-aware minifier, compiler validation, or tests. Source containing --, long strings, escapes, or adjacent operators needs care because removing whitespace can change tokenization. Validate with the Lua runtime that will execute the code.
Minification is not obfuscation or a performance guarantee. Names and strings may remain exposed. Review copied text for confidential source, keep readable originals in version control, and treat compact output as a regenerable build artifact.
Related
Discover related tools, collections, and available API capabilities.