HomeDeveloper toolsJavaScript AST Explorer

JavaScript AST Explorer

Parse JavaScript into an abstract syntax tree with source locations.

Processing stays in your browser. Uses Acorn and does not execute the code. Supports JavaScript syntax, not TypeScript or JSX; large ASTs are capped for browser responsiveness.

How to use the javascript ast explorer

Parse JavaScript into an abstract syntax tree with source locations. Complete the javascript, source type fields above, or upload a UTF-8 text file for javascript. Choose Run tool, review the output, then copy or download the result.

Example

An arrow function appears as an ArrowFunctionExpression node.

Good to know

Uses Acorn and does not execute the code. Supports JavaScript syntax, not TypeScript or JSX; large ASTs are capped for browser responsiveness.