EN DE

Free, privacy-first

Roblox Luau Formatter

Clean up common Roblox Luau snippets with predictable indentation and safer copy-paste output for Studio workflows.

Luau input

Formatted Luau output

The formatter focuses on safe, common cleanup work and surfaces warnings when a snippet looks too advanced for a lightweight formatter.

Good use cases

A good fit when a Luau snippet is messy but still structurally simple enough for a conservative formatter.

  • Clean up a pasted Studio script before review.
  • Re-indent if/then, loops, and function blocks after quick edits.
  • Turn dense semicolon-heavy lines into something easier to scan.

How to review the output

Treat the formatted result as cleanup help, not as a guarantee that the code is fully valid or stylistically perfect.

  • Quiet warnings usually mean the formatter stayed in safe territory.
  • If multiline strings or block comments appear, review the output manually before trusting it.
  • Use the Lua Table Formatter when the real problem is a dense table block rather than a full script.

Paste the Luau code, choose an indent size, then review the output and warnings before copying it back into Studio.

  1. Paste the Luau snippet you want to clean up.

  2. Set the indent size you prefer for nested blocks.

  3. Run the formatter and review any warnings about multiline or advanced syntax.

  4. Copy the cleaned output once the structure looks right.

Typical Luau cleanup jobs

Each example loads into the tool and runs, so the stated result is exactly what you will see.

Split a semicolon-joined line

Turn a dense one-liner into separate statements.

Sample inputs

Code
local coins=5;if coins>0 then print(coins) end
Indent
4 spaces

Result: The semicolon splits this into two lines: `local coins=5` then `if coins>0 then print(coins) end` (1 line in, 2 out). The already-single-line if block is left intact.

Re-indent an if block

Fix the body indentation of a multi-line control-flow block.

Sample inputs

Code
if x then print(x) end
Indent
4 spaces

Result: The body is indented to 4 spaces, giving `if x then`, ` print(x)`, `end` — 3 lines, 1 changed, max block depth 1.

Use a 2-space indent on a loop

Apply a custom indent size to a for block.

Sample inputs

Code
local t={a=1,b=2} for i=1,3 do print(i) end
Indent
2 spaces

Result: With a 2-space indent the loop body becomes ` print(i)`, so the for/do/end block reads cleanly at depth 1 while the table line is left unchanged.

Indent size is configurable from 2 to 8 spaces.