Javascript Formatter

Input Javascript
Formatted Javascript

Waiting for input.

Javascript Formatter Options

Javascript Formatter Online

Javascript Formatter is highly configurable online formatting tool to beautifully format Javascript in way it is easily readable for humans. Javascript beautifier adds necessary indentations and it prettifies it with syntax highlighter. It supports JSX and TSX formatting as well. It also supports JSLint happy formatting styles.

Javascript Beautifier Options

By default, javascript beautifier is configured to use google style guide recommendations. You can always configure it to your need. Below are the exposed configuration options available.

  • Indentation Level - 2 Space Indent by default - The tags and contents are indented using 2 spaces.
  • Remove Empty Lines - Allows to keep 2 empty lines - Adds a line break and one black line between tokens/tags.
  • Line Wrap - Wraps lines at 120 characters.
  • Brace Style - This for indenting or placing {}, [] brackets.
  • End with new line - Adds a new line to end of file.
  • Indent Empty Lines - Used to carry indentation on empty lines and line breaks between tags.
  • Support JSX/TSX - Formats React JSX and TSX files as well.
  • Keep Array Indentation - Not to modify array indentation and keep it as it is.
  • Break lines on chained methods - If methods are chained, enabling this option will break those chained methods into new line.
  • Adds space before condition - Adds a selected indent, before conditions.
  • JSLint Happy Formatting - Formats the javascript code recommended by JSLint.

Javascript Formatter Usage

Below is the uglified or compressed javascript, just paste this the input and format it.

/** Paste Javascript code without <script> tag, to format with <script> tag use HTML Formatter. */alert("Welcome to !!!");function sum(num1, num2){return num1 + num2;}

Below is the beautifully formatted javascript

/** Paste Javascript code without <script> tag, to format with <script> tag use HTML Formatter. */
alert("Welcome to !!!");
function sum(num1, num2) {
return num1 + num2;

If you want to reverse this function, you can use Javascript Minifier Online Tool.