JavaScript Validator
Check JavaScript syntax in your browser with this free JavaScript validator. It parses with Acorn and never executes your code. Use ES5 / ES2015+ / Latest and Script / Module to match the environment you ship.
A successful result always repeats that this is syntax-only — it will not catch logic errors.
Input
Paste or type your content here…
Results
Paste JavaScript code to check its syntax.
Frequently Asked Questions
Does this run my JavaScript?
Never. We only parse to an AST with Acorn. There is no eval, no Function constructor, and no iframe execution.
Will it catch logic bugs?
No - only syntax errors (missing braces, invalid tokens, etc.). Unit tests still matter for behavior.
Can I validate TypeScript?
TypeScript-specific syntax is not supported. Strip types or use a TS-aware tool for .ts files.
Module vs script mode?
Module allows import/export. Script mode matches classic script tags without module semantics. If you paste import/export in Script mode, the error tells you to switch.