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

Lua Checker reads pasted Lua and reports a syntax error, with the line and column. You can check it as Lua 5.1, 5.2, 5.3, or LuaJIT. It does not run the script, and a name such as print is not an error just because this page never defined it.

A syntax check

The paste stays in the browser.
  • 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 the source. The result updates as you type.
  1. Paste Lua

    The sample is a small function. Replace it with the script you want to check.

  2. Pick the version

    Lua 5.3 is the default. Switch to 5.1, 5.2, or LuaJIT when the script targets that language.

  3. 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

Syntax is not the same as a working script.
  • 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

One snippet, before you run it somewhere else.
  • 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

A yes or a line number.
  • 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

Syntax for four Lua dialects.
  • 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

What a Lua statement list is, and what this page does not do with it.
  • “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 5.4 Reference Manual — Statements

    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:”
    — Lua 5.4 Reference Manual — Blocks

    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

Frequently Asked Questions

Quick answers about this tool—open a question to read more.