No syntax errors
Checked as Lua 5.3. The script was not run.
A name such as print is allowed even when nothing defines it. Lua 5.4 attributes such as <const> are outside this checker.
Help Us Improve
—
(—)
Check Lua syntax
Check pasted Lua for syntax errors and show the line that failed. The script is not run. Free, with no signup.
What this Lua checker does
A syntax check
Lua checker
A failed parse shows the line, the column, and the parser message.
Four language versions
Lua 5.1, 5.2, 5.3, and LuaJIT. A label is valid in 5.2 and an error in 5.1.
Comments are allowed
Line comments and long comments are part of the syntax. They are not treated as errors.
Nothing is uploaded
The check runs in the browser. The page does not save the paste.
How to check Lua
Paste Lua
The sample is a small function. Replace it with the script you want to check.
Pick the version
Lua 5.3 is the default. Switch to 5.1, 5.2, or LuaJIT when the script targets that language.
Read the line
A syntax error names the line and column. A clean parse says there is no syntax error.
What a clean result does not mean
Unknown names are allowed
print, pairs, and your own globals are not reported. The checker does not look them up.
Lua 5.4 attributes are outside this check
A local marked <const> or <close> is reported as a syntax error. This page does not parse those attributes.
Keep the paste under 100,000 characters
Longer source is refused so the page stays responsive.
When you want a syntax answer
A snippet that will not load
See the line the parser rejected instead of guessing which end is missing.
A 5.1 script on a newer habit
Labels and goto are an error in 5.1 and valid in 5.2.
A paste you do not want to upload
The check stays in the browser.
What you get
No signup
Paste and read the result. There is no account step.
Free
The check does not add a watermark or a timer.
Nothing is uploaded
Parsing runs in the browser.
What the checker covers
Versions
Lua 5.1, Lua 5.2, Lua 5.3, and LuaJIT.
Reported
The first syntax error, with a line, a column, and the parser message.
Not included
No runtime, no undefined-global check, and no Lua 5.4 attribute syntax.
Sources & References
“Lua supports an almost conventional set of statements, similar to those in other conventional languages. This set includes blocks, assignments, control structures, function calls, and variable declarations.”
Lua statements include blocks and calls: The checker parses that syntax. It does not execute the statements. lua.org/manual/5.4/manual.html#3.3
“A block is a list of statements, which are executed sequentially:”
A block is a list of statements: A missing end or a broken expression stops the parse. The page shows that line and does not run the block. lua.org/manual/5.4/manual.html#3.3.1