Code Beautifier

Open Source

by Beautifier.io

Provided by Beautifier.io

Not yet rated
Platform
Web
Pricing
Open Source
Account required
No
Ads
Light
Last verified
15 hours ago
Developer
Beautifier.io
Official URL

Overview

Beautifier.io is the online home of js-beautify, a long-running open-source code formatter. You paste messy or minified code into the editor, press the button, and get it back with consistent indentation and line breaks. It handles JavaScript, JSON, React JSX, HTML, CSS, SCSS and SASS.

A row of options controls the result: tabs or 2, 3, 4 or 8 spaces, how many blank lines to keep, where to wrap long lines, brace style, how style and script blocks inside HTML are indented, and how HTML attributes wrap. It can also detect code that was packed by some common packers and obfuscators and unpack it first, which helps when reading a compressed script. Further settings can be supplied as JSON.

The project is MIT licensed, was created by Einar Lielmanis and is maintained by Liam Newman. The same formatter is available as a command-line tool, as the js-beautify package on npm and as the jsbeautifier package for Python, so the website doubles as a quick way to try settings before using it in a build.

Features

  • Formats JavaScript, JSON, JSX, HTML, CSS, SCSS and SASS
  • Indentation with tabs or 2, 3, 4 or 8 spaces
  • Controls for blank lines, line wrapping and brace style
  • Separate options for script and style blocks inside HTML
  • Detects and unpacks some packed or obfuscated scripts
  • Extra settings accepted as JSON
  • Code editor with syntax highlighting
  • Same engine available on npm, PyPI and the command line

Privacy

See the official privacy policy. The page loads the formatter scripts into the browser and includes a Google Analytics script.

Pros & Cons

Pros

  • Free and open source under the MIT licence
  • No account or sign-up
  • More formatting options than most online beautifiers
  • Settings carry over to the npm and Python versions

Cons

  • Does not validate code or report errors
  • No support for TypeScript or languages beyond the web trio
  • The unpacker option is marked as unsafe for untrusted code
  • Plain interface with no file upload or saved history

Community Reviews (0)

No written reviews yet — be the first to rate this tool.

Similar Tools

  • Code Beautifiers · Prettier

    Formats code consistently across many languages.

    Not yet rated
    Open Source Web