Code Formatter & Beautifier
Paste messy SQL, Python, HTML, CSS, or JavaScript and get clean, consistently indented code back. Formatting runs entirely in your browser via Prettier and sql-formatter — nothing is uploaded.
Format code
Auto-formats as you type · 300 ms debounceHow to use
Five-step workflow. Sample data is bundled for each language so you can verify the formatter instantly.
- Pick a language — SQL, Python, HTML, CSS, or JavaScript. The options panel adapts; SQL gets a keyword-case selector.
- Set indent and width — choose tabs, 2 spaces, or 4 spaces, and a print width between 40 and 200. Defaults are 2 spaces / 80 columns.
- Paste or load sample — drop your messy code into the Input pane on the left, or press Load sample to see a realistic example formatted immediately.
- Auto-format — the Output pane updates 300 ms after you stop typing. Press Format to force a re-run, or Clear to reset both panes.
- Copy or download — press Copy output to copy to clipboard, or Download to save with the correct file extension (
.sql,.py,.html,.css,.js).
What it formats
SQL
One-liner SELECT statements, JOINs, subqueries — formatted by sql-formatter with selectable keyword case (UPPER / lower / preserve).
Python
Heuristic indentation re-flow based on colon-terminated lines. Handles mixed tabs/spaces and collapsed nested blocks.
HTML
Prettier HTML parser — expands minified markup, normalizes attribute quoting, breaks long lines at the configured print width.
CSS
Prettier PostCSS plugin — one rule per line, aligned declarations, sorted where unambiguous, consistent trailing semicolons.
JavaScript
Prettier Babel plugin — expands minified arrow chains, normalizes quotes and semicolons, enforces 2-space style by default.
Privacy
100% client-side. No paste is sent anywhere — verify in DevTools → Network. Only library bundles load from CDN on first visit.