Works on this device. File exports run online.
Code Syntax Checker
Paste code or choose a file. The checker reads it with the language’s own rules and shows the first syntax error with its line and column, or says that the syntax is right. The code is only read, never run.
Check the syntax
How to check code
- Paste the code or choose a file. The language is found from the file name or the first line; you can also choose it.
- JavaScript, JSON, YAML, XML and TOML are checked at once in your browser.
- For Python, Bash and sh, press “Check on the server” below: their own parsers (Python’s ast module, bash -n, dash -n) read the code on the Toolvito server.
- Press the line number to go to the error, fix it and check again.
Which checker reads which language
- JavaScript: acorn 8.19.0, with the newest ECMAScript syntax it knows, as a script or as a module (import and export). JSX and TypeScript syntax (such as type annotations) is not JavaScript and is reported as an error.
- JSON (RFC 8259), YAML 1.2, XML 1.0 (well-formed, no DTD check) and TOML 1.0: the readers of this site.
- Python: ast.parse of Python 3.12 on the server, with the grammar of Python 3.8 to 3.12 (older grammars are best-effort, as the Python documentation says). Warnings such as an invalid escape sequence are listed too.
- Bash: GNU bash 5.2 with -n, which reads the commands without running them; tick extglob for patterns such as +(…). POSIX sh: dash with -n, so Bash-only syntax such as arrays is an error there.
Limits you should know
- Each parser reports the first syntax error only. Bash and sh give the line, not the column.
- Only the syntax is checked: a misspelt variable, a wrong type or a missing file is found only when the code runs, and nothing is run here.
- PHP, Ruby, Go and other languages are not checked here.