Code formatter and minifier

Make messy or minified code readable again, or shrink it for production. Paste HTML, CSS, JavaScript, SQL or XML, choose beautify or minify and copy the result. Your code stays in your browser.

Free and private. Everything runs in your browser, nothing is uploaded.

How it works

  1. Paste your codePaste code, type it or open a file. The language is picked from the file extension.
  2. Beautify or minifyChoose the language and whether you want readable or compact code. The result updates as you type.
  3. Copy or downloadCopy the result with one click or download it as a file.

Readable when you work, compact when you ship

Code copied from a browser, an email or a minified bundle is often one endless line. Beautifying adds consistent line breaks and indentation so you can read, review and debug it. Minifying does the opposite and removes comments and spaces to make files smaller and pages faster.

The formatters only change whitespace and comments. Names, values and the order of your code stay exactly as they were.

Private by design

Many online formatters send your code to a server. Here everything runs in your browser, so API keys in scripts, customer queries and internal markup never leave your computer.

Frequently asked questions

Is my code uploaded anywhere?

No. Formatting and minifying run in your browser. Your code is not sent to our servers.

Does minifying rename my variables?

No. Minifying removes comments, line breaks and spaces only. Names stay readable and the code behaves exactly the same, which makes it safe for any file.

Why are some line breaks kept in minified JavaScript?

JavaScript treats some line breaks as the end of a statement. Where removing one could change what the code does, it is kept.

Can I format JSON here?

JSON has its own tool with a tree view and validation. Use the JSON Tools page linked below.

Does it work offline?

Yes. After you open the page once, it keeps working without an internet connection.