Pinpoint syntax errors
Paste your code and it's parsed with Acorn, a standards-compliant JavaScript parser. If there's a syntax error, you'll see its exact line and column with the line shown, instead of a vague browser console message.
Choose the ECMAScript version — Latest, ES2020, ES2015 or ES5 — to check whether code will run in older browsers, and whether to parse it as a module or a script. The validator also points out debugger statements, eval() calls, loose == comparisons and leftover console calls.
How to validate JavaScript
- 1
Paste your code
Any script or module.
- 2
Choose the version
Latest, or older for compatibility.
- 3
Click Validate
Fix any reported line.
Key features
Exact error positions
Line and column.
Version targeting
ES5 to the latest standard.
Code-quality hints
debugger, eval and loose equality.
Private
Runs in your browser.
Common uses
- Debugging: Find the missing bracket or comma.
- Legacy support: Check code works in old browsers.
- Reviewing snippets: Validate code from tutorials and forums.
Tips and good to know
- TypeScript and JSX aren't plain JavaScript; compile them first or expect errors.
- Make minified code readable with the JavaScript Beautifier.
