JavaScript Formatter

Free online JavaScript beautifier and minifier.

JS JSL Formatter Interactive Tool
Input

The JavaScript Formatter beautifies or minifies JavaScript and TypeScript code. It tokenizes the source with a custom parser that understands strings, template literals, regex literals, line comments and block comments, so formatting never corrupts your code. A single click switches between pretty-printed output and a compact minified version.

The tool runs entirely in your browser. No code is sent anywhere, which makes it safe to format work-in-progress source, configuration snippets and personal scripts.