Loading tool…
Setting up your workspace on this device.
Format JavaScript, CSS, SQL code.
Loading tool…
Setting up your workspace on this device.
Advertisement
Code Beautifier formats messy or minified JavaScript, CSS, HTML and SQL into clean, consistently indented code. Pick a language, paste your code and the formatted version appears as you type. JavaScript, CSS and HTML are formatted with Prettier; SQL uses sql-formatter, with a choice of standard SQL, PostgreSQL, MySQL or SQLite and UPPER, lower or preserved keyword case. Set the indent to 2 or 4 spaces, or tick Use tabs. If the code cannot be parsed, the error appears in place of the output. Formatting runs in your browser, so private code stays on your machine.
Pick a language
Choose JavaScript, CSS, SQL or HTML, or press Load sample to see an example.
Paste your code and set options
Choose a tab width of 2 or 4 spaces or tick Use tabs. For SQL, also pick a dialect and keyword case.
Copy the result
The output updates as you type. Press Copy output once it says Output is up to date.
JavaScript, CSS, HTML and SQL. For JSON, use the JSON Formatter instead.
Choose SQL, pick the dialect that matches your database (standard SQL, PostgreSQL, MySQL or SQLite) and paste the query. Clauses such as SELECT, FROM and WHERE go on their own lines, and keywords are upper-cased unless you choose lower or Preserve.
No. Only layout and style details change, such as indentation, line breaks, quotes and semicolons in JavaScript; the logic stays the same.
The formatter has to parse your code first, so a syntax error such as a missing bracket or an unfinished string stops it. The error message usually names the line and column to look at.
Yes. Code Beautifier is completely free, with no account, no paywall, and no usage limits.
No. Code Beautifier works instantly in any modern web browser — there is no software to install, no extension, and no sign-up.