Skip to content

Luau beautifier and formatter

Paste a script and get it back cleanly formatted. One-liners are split, indentation is fixed and nothing about the logic changes.

StyLua 2.6 the same formatter used in Rojo projects · Checked October 16, 2026

Formatted
Ctrl + Enter formats
How it works

What it changes

  • Statements that share a line are split onto their own lines.
  • Indentation follows the real block structure, including nested functions and tables.
  • Spacing around operators, commas and brackets is made consistent.
  • Long calls and tables are wrapped at the line width you choose.
  • Strings, comments and the meaning of your code stay exactly as they were.

Formatting is done by StyLua with Luau syntax enabled, so type annotations, compound assignment (+=), continue, string interpolation and generics all work. If the script has a syntax error, the formatter tells you the line instead of guessing.

Example

Before:

local Players=game:GetService("Players") Players.PlayerAdded:Connect(function(p) if p.AccountAge<7 then p:Kick("Account too new") end end)

After:

local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(p)
	if p.AccountAge < 7 then
		p:Kick("Account too new")
	end
end)

When to use it

Use it when the code is not in Studio yet: a snippet from a DevForum post, a plugin file, a model script you are checking before you trust it, or code you are reviewing on your phone. Readable code is also the fastest way to spot a hidden require() or a suspicious loadstring in a free model.

Questions

Does it work with Luau type annotations?

Yes. The formatter parses Luau, so local x: number = 1, export type, generics, += and continue are kept and formatted.

Is my code uploaded?

No. StyLua runs as WebAssembly inside your browser tab. The script never leaves your device.

Tabs or spaces?

Tabs by default, like Studio. Switch to 2 or 4 spaces with the indent buttons.

What is the difference from the minifier?

The formatter makes code easier to read. The minifier does the opposite: it removes comments and whitespace to make the script as short as possible.