a toolbox for the web.

Online Javascript Beautifier/Formatter Tool

To beautify your javascript online paste it into the editor on the left and your formatted javascript will appear on the right after you have chosen your options in the centre console.

What is this tool?

It is a complete online solution for formatting/beautifying javascript. Sometimes you only have a copy of the code that has been minified or written by an extremely messy developer. This tool will allow you to format that javascript in a way that is clean and useable.

You can import javascript into the tool VIA a URL on the web, from a file on your machine or by simply placing it into the editor on the left. On the centre console, you can choose to minify or beautify the output.

When formatting you can choose the level of indentation in terms of spaces and whether to preserve newlines and how many should be preserved. This could be useful for code, which has huge gaps between functions.

The brace style formats the code like so:

Collapsed:
if ($('#beautifier').length) {
  $(document).on('click touchend', '#load', function() {
    var url = $(this).val();
  });
};
Expanded:
if ($('#beautifier').length)
{
  $(document).on('click touchend', '#load', function()
  {
    var url = $(this).val();
  });
};

Once you have finished formatting you can copy the code out of the editor to your clipboard using the icon on the bottom right, or download a .js file directly to your computer.