JavaScript Formatter
Make JavaScript source easier to read. Parsing and formatting do not run your code.
How to use it
- Paste JavaScript or open a UTF-8 file. Load the example to try it.
- Choose indentation, then select Format JavaScript.
- Review the output. If an error appears, correct your input and try again.
- Copy the result or download javascript-formatter.js.
Formatting is not execution
Uses Prettier with its Babel parser for JavaScript and JSX. TypeScript is not supported here. Formatting may change quotes, semicolons, and parentheses while retaining parsed meaning. It does not fix program logic, resolve imports, bundle dependencies, or transpile syntax for older browsers.
Only the required local processor is loaded when you run the tool. Large jobs run in a cancellable background worker. Source and results remain text, including scripts, markup, and URLs.