ToolsMaxxing

HTML, CSS and JS beautifier

Indent and tidy minified or messy HTML, CSS and JavaScript so it is readable again.

Your files stay on your device

How it works

  1. 1Choose JavaScript, CSS or HTML.
  2. 2Paste your code, or choose Try an example.
  3. 3Pick the indent and, for JavaScript, quotes and semicolons.
  4. 4Copy the formatted code or download it.

What the options do

Indent
Two spaces, four spaces or a tab for each level.
Single quotes
Writes JavaScript strings with single quotes where possible.
Semicolons
Adds semicolons at the end of JavaScript statements, or leaves them out.

Privacy

Everything runs in your browser. What you paste is never sent to a server.

Questions people ask

Which formatter does this use?

Prettier, the same formatter many projects run on save. Its rules are opinionated, so the output matches what a Prettier-formatted project would produce, with the options you choose.

Does beautifying change what the code does?

No. Only whitespace, line breaks and, for JavaScript, quote style and semicolons change. The program behaves the same.

Can it restore the original variable names?

No. Minifiers throw away the original names, so a beautified file is easier to read but a, b and c stay a, b and c.

Why does it show an error?

The code could not be parsed. The message gives the line and column and a few lines of context. Fix that spot and the result appears again.

Is JSX or TypeScript supported?

JSX in JavaScript is accepted. TypeScript is not supported in this tool.

Related tools