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

Paste Lua or Luau source, choose a dialect and style options, then format it or check syntax without changing the input.
Your result appears here
Paste Lua or Luau code, then format it or check syntax on its own.
StyLua WebAssembly processes code in a browser Worker. The formatter engine is loaded on first use.
Overview
Understand what the tool solves, how it works, and the boundaries of its data.
A Lua formatter rearranges indentation, spaces, line breaks, and string quotes so source follows a consistent reading style. A syntax check asks whether the selected dialect can parse the input. A parse failure returns an engine error; a successful parse only means the syntax is recognizable. It does not prove that program logic is correct or that a runtime provides the APIs the code calls. Formatted text can be copied back to a project editor for review.
This page uses StyLua's parser and printer. The dialect choices cover Lua 5.1, 5.2, 5.3, 5.4, LuaJIT, and Luau. Syntax extensions differ; for example, Luau type assertions can conflict with Lua 5.2 label syntax. Selecting the target dialect is more reliable than guessing from a mixed syntax sample. Formatting is not type checking, code auditing, or minification.
Guide
Follow the workflow and verify inputs and outputs with practical examples.
Paste a Lua or Luau snippet, or load the page example. Split very large files into related sections. If the project relies on formatter directives in comments or repository configuration, return to the original project after formatting and verify those conventions.
Choose the dialect used by the actual runtime. Roblox scripts usually use Luau; embedded and older projects should match their Lua interpreter version. A filename extension alone does not identify the syntax reliably.
Set two or four spaces, tabs, and a preference for single or double quotes. Quote style is a presentation preference; StyLua may still choose a string spelling that avoids unnecessary escapes.
Choose Format code to inspect and copy the result. Choose Check syntax to parse the current input without replacing the result. Before adopting a change, parse and run the relevant cases with the compiler or editor used by the target project.
Use cases
See how the tool fits into real work and everyday tasks.
While maintaining a configuration script, a developer can normalize indentation and quotes before a review so a diff emphasizes logic instead of whitespace. Formatting only changes source presentation; inspect comments, long strings, and team conventions to make sure the output still fits the project.
Someone learning Lua or Roblox Luau can paste an exercise, check that its syntax parses, and observe how nested blocks and expressions are laid out. If a diagnostic involves host objects such as `game` or `Instance`, or a third-party library, this parser does not supply Roblox Studio's environment type definitions. Use the target platform's editor for those diagnostics.
Q&A
Find concise answers to common questions and confusing cases.
No. It checks whether the selected dialect can parse the code. It does not prove that names exist, types match, dependencies load, or runtime behavior is correct. Compile and run relevant cases in the target environment.
The dialects have different extensions, and some token combinations are ambiguous. Select Luau when the source uses Roblox type annotations or Luau-specific syntax instead of asking a standard Lua parser to interpret it.
No. A paste-based page cannot read local project files, so its dialect and style choices apply only to this run. Keep the project's configuration in version control and use the formatter command adopted by the team for release work.
Notes
Review scope, result limitations, and important precautions before use.
A successful parse is not a static analysis result. Formatting does not check undefined names, unused variables, API availability, permissions, or security issues. Lua hosts expose different globals and libraries, so syntactically valid code can still behave differently in a game engine, embedded device, or server process.
StyLua rewrites layout from a syntax tree, but comment directives, generated source, and project-specific style rules still deserve comparison. Review the diff, keep the original, and compile or run tests with the actual interpreter version or IDE before adopting the output. Input is processed by a browser Worker; the page loads the formatter engine, so avoid copying confidential source into public links or unapproved environments.
Related
Discover related tools, collections, and available API capabilities.
Lua Code MinifierTrim comments and whitespace from Lua source, compare the before-and-after text length, and copy the compact result for review.
Luau Static Analyzer and Type CheckerAnalyze Roblox Luau snippets in the official Luau Playground and review type diagnostics and editor hints.
Lua Bytecode DecompilerTry to reconstruct readable Lua source from standard Lua, LuaJIT, or Luau bytecode in your browser, then copy or download the result.