Lua Beautifier
Paste compact Lua source and indent it based on Lua block keywords like do, then, function, and end.
Last updated: May 29, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is Lua Beautifier?
Lua Beautifier formats Lua snippets so functions, loops, conditionals, and table constructors are easy to read. Because Lua uses keywords such as do, then, function, repeat, and end to delimit blocks instead of braces, the formatter indents based on those keywords and on table braces. It is intentionally lightweight and focuses on indentation and line breaks rather than parsing or rewriting the program.
How to Use Lua Beautifier
Paste Lua source code.
Choose indentation style.
Click Format.
Review the beautified Lua output.
Copy or download the .lua file.
Common Use Cases
- Cleaning Lua examples before adding them to a game mod or config.
- Reading compact code copied from a forum or gist.
- Indenting Neovim or Roblox Lua snippets for review.
- Preparing Lua samples for documentation or screenshots.
Example Input and Output
A one-line Lua function is expanded with block indentation.
function greet(name) if name then print("Hi "..name) end endfunction greet(name)
if name then
print("Hi " .. name)
end
endPrivacy
Lua code is beautified locally in the browser and is not uploaded.
Frequently Asked Questions
Does this validate or run Lua?
No. It formats text for readability only. Use a Lua interpreter such as lua or luajit to run or check your code.
How does it know where to indent?
It indents after block keywords like do, then, function, and repeat, and dedents at end, until, else, and elseif. Table braces are indented too.
Will it change my program behavior?
No. It only adjusts whitespace and line breaks.
Is my source code uploaded anywhere?
No. Beautification runs entirely in your browser.
Related Tools
C Beautifier
Beautify C source snippets by expanding braces and statements into readable, consistently indented code.
C++ Beautifier
Beautify C++ source by expanding braces, loops, and statements into readable, consistently indented code.
JavaScript Beautifier
Format and beautify minified or messy JavaScript code.
Code Highlighter
Paste code in JavaScript, TypeScript, Python, HTML, CSS, SQL, JSON, or Bash and get a syntax-highlighted HTML snippet you can embed anywhere. Live preview and copy-ready output.
Code to Image Converter
Convert code snippets to beautiful images for sharing.
Java Beautifier
Beautify Java source by expanding classes, methods, loops, and statements into readable, consistently indented code.

