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.

