Code Formatter & Beautifier

Free online code formatter and beautifier from Bee Tools. Format JavaScript, TypeScript, JSON, CSS, SCSS, HTML, Markdown, YAML, and SQL in one click with configurable indentation. Runs locally in your browser, no upload, privacy-friendly.

Format JS, CSS, HTML, SQL and more in one click. Supports JavaScript / TypeScript / JSON / CSS / SCSS / LESS / HTML / Markdown / YAML and SQL, with selectable indentation. Everything runs locally in your browser, code is never uploaded, protecting your privacy.

State:

Code Formatter Guide

What this tool does

  • Multi-language formatting: beautify JavaScript, TypeScript, JSON, CSS, SCSS, LESS, HTML, Markdown, and YAML in one click.
  • SQL beautifier: format SQL statements with consistent keywords and indentation for better readability.
  • Configurable indentation: 2 spaces, 4 spaces, or Tab.

Tips

  1. Select the "Language / Type" that matches your code first, otherwise formatting may fail.
  2. JavaScript and JSX use the babel parser; for TypeScript / TSX choose TypeScript.
  3. If your code has syntax errors, formatting will fail with a location hint. Fix it and retry.

Privacy

This tool runs locally in your browser and never uploads your code to a server.

Open Source Notice: code formatting is powered by prettier (MIT License); SQL beautifying is powered by sql-formatter (MIT License).

FAQ

Will my code be uploaded to a server?
No. Formatting happens locally in your browser and code is never uploaded.
Which languages are supported?
JavaScript, TypeScript, JSON, CSS, SCSS, LESS, HTML, Markdown, YAML, and SQL.
Why does formatting fail?
Usually because the code has syntax errors, or the selected language type does not match your code. Verify and retry.
Can I set the indentation?
Yes. 2 spaces, 4 spaces, or Tab indentation are supported.
Which SQL dialects are supported?
SQL beautifying is powered by sql-formatter, defaulting to standard SQL, which covers most common statements.
How do I format TypeScript?
Select TypeScript / TSX in the language dropdown; it uses the babel-ts parser internally.
Will my privacy be leaked?
No. This tool never uploads your code and requires no login.