JavaScript Formatter
Beautify, format, validate, and minify JavaScript code with customizable indentation rules, ASI safety checks, AST structure analysis, and safe sandboxed execution console.
Input JavaScript Code
0 charsECMAScript ES2024 Formatting Standards & Developer Specification Reference
ASI Safety Preservation
Automatic Semicolon Insertion (ASI) sensitive boundaries (e.g., return \n { ... }, array indexing) are preserved without introducing accidental semantic changes.
ES6+ Class & Private Fields
Constructors, private class fields (#privateProp), static blocks (static { ... }), arrow functions, and destructuring are preserved intact.
Execution Sandbox Security
Console execution preview runs in a sandboxed <iframe sandbox="allow-scripts"> without allow-same-origin, preventing script access to local cookies or parent storage.
Template Literals & Regex
Template literal expressions (\`Hello \${name}\`), multiline backtick strings, and complex regular expression literals (/https?:\\/\\//gi) remain preserved.