Code formatter

Pretty-print CSS, HTML or SQL.

🔒 This file is processed in your browser. It is never uploaded anywhere.

What it is for

Formatting code means reorganising its spaces, line breaks and indentation so the structure is visible at a glance. It changes nothing about what the code does: the program behaves exactly the same before and after.

It is needed more often than you would think. Minified code downloaded from a website is unreadable by design. SQL returned by a tool arrives as one endless line. And CSS that has passed through several hands usually carries a mixture of indentation styles that makes it hard to follow.

Well-formatted code is reviewed faster and hides fewer bugs, because indentation makes it obvious what sits inside what and where a closing bracket is missing.

How it works

  1. Choose the language: CSS, HTML or SQL.
  2. Paste your code, even if it's all crammed into a few lines.
  3. Click "Process" and copy the result, now indented and readable.

When to use it

Understanding someone else’s code

Formatting a downloaded CSS or HTML is the first step to being able to read and modify it.

Reviewing SQL queries

A long query on one line becomes comprehensible when each clause gets its own row.

Unifying style

When a file mixes indentation from several sources, formatting makes it consistent.

Practical tips

  • Formatting does not alter behaviour, only appearance.
  • If the code has a syntax error, formatting may fail or produce something odd: a useful signal that something is unclosed.
  • It covers CSS, HTML and SQL. For other languages, code editors have formatters built in.
  • Always keep the formatted version as your working copy, and minify only when publishing.

Frequently asked questions

Does it also format JavaScript?

Right now this tool covers CSS, HTML and SQL; for JavaScript you can use a local editor together with the "Code minifier" the other way around.

Does formatting change my code's logic?

No, it only adjusts spacing, line breaks and indentation; the code's behavior stays exactly the same.

Related tools