JavaScript Validator
Check that a script parses as a module.
About this tool
A successful result means the syntax parsed. Types are not checked.
The code is never evaluated.
How to use it
- Open this page and provide the input it asks for.
- Set the options that are visible, then use Check syntax.
- Read the result in the panel. Copy it or download it when a file is offered. The input stays in this browser.
Limitations
- The code is never evaluated.
Acorn accepts the paste as a module
The success text is a parse, and the code stays unrun
Acorn parses the paste as a module. The options are the latest ECMAScript version the library offers and a module source type. When the parse returns, the page reports that the syntax parsed as a JavaScript module, and that this was not a type check and the code was not run. No function is called. No network import is loaded. An identifier that does not exist is still a successful parse if the grammar allows the mention.
Module source type changes which programs are legal. Import and export syntax can parse. Top-level await can parse. A return statement sitting at the top of the file is rejected, because a module body is not a function body. A snippet copied from an event-handler attribute may fail for the same family of reasons: it was never a module. The page does not wrap your paste in a function to make it parse.
Types, lint, and runtime are out of scope
A parsed module can still throw the moment it runs. A missing export, a null property, and a failed fetch are runtime facts. A type error that a separate checker would flag, such as passing a string where a number was declared in another system, is invisible here because no types are read. Unused variables are not reported. Style rules are not applied. The beautifier can print source that this parser would reject, and this parser can accept source the beautifier would space differently. They answer different questions.
How to read a failure
The parser’s own message is the failure. It points at grammar, not at your product rules. Fix the token it names, then parse again. If the goal was shorter code, the minifier is the other page, and it will rename locals while it compresses. If the goal was indent, the formatter does not give you this verdict. Use this page when you need to know that the current text is a module the parser accepts.
Privacy
Your input is processed in your browser and is not uploaded to UtilChain. File names, text, and results are not sent to analytics.

