← All Tools

JavaScript Beautifier🔒 100% local

Format and indent JavaScript code for readability. Configurable indent size.

Indent Size (spaces)
JavaScript Input

Related Tools

JS Object FormatterJSON FormatterCSS Beautifier

Runs a character-level reformat over the JavaScript you paste: braces are given their own lines, every semicolon starts a new line, and nesting is indented by the width you set (1 to 8 spaces). There is no parser and no evaluator involved - the text is split on braces, brackets, semicolons and commas and reassembled - so nothing you type is sent anywhere; the whole pass happens in the tab you already have open.

How to use it

  1. Replace the sample line in the input box with your own JavaScript.
  2. Set the indent size if two spaces is not what you want.
  3. Press Beautify and read the result in the lower box, then Copy Output to put it on the clipboard.

Worked example

const x=function(y){return y*2};becomesconst x=function(y){ return y*2 } ;

The space after the opening brace, the semicolon pushed onto its own line and the trailing newline are all part of the tool's output - it does not tidy spacing around operators.

When to use it

What it does not do