🖊️

JS Beautifier

Format and pretty-print minified or compressed JavaScript with proper indentation and consistent spacing.

Input JavaScript
Formatted JavaScript

About JS Beautifier

JavaScript Beautifier reformats minified or single-line JavaScript into readable code with consistent indentation. It tokenises the code preserving string literals and comments, then re-indents based on opening and closing braces, brackets, and parentheses.

Features

  • Indent control — Choose 2 spaces, 4 spaces, or tab indentation.
  • String-literal safe — Content inside quotes is never modified.
  • Handles minified code — Adds line breaks after statements and blocks.

FAQ

No. If the code was minified with variable renaming (e.g. Terser, UglifyJS), the short variable names cannot be restored. This tool only reformats the whitespace and structure.
No. All formatting runs in your browser. Your JavaScript is never transmitted anywhere.