Free SQL Formatter

Format and indent SQL queries for readability across many dialects.

Loading tool…
  • 🔒 Files never leave your device
  • ⚡ Converted in your browser
  • ✅ No account required

SQL Formatter: The Complete Guide

Paste a cramped or one-line SQL query and get clean, indented, readable SQL. Choose your dialect and keyword casing, then copy the formatted query.

How to use the SQL Formatter

  1. Paste or type your code, text, or data into the input box.
  2. Adjust options such as indent size, dialect, or flags when the tool offers them.
  3. The output updates instantly — copy it to your clipboard or download the file.

Features

  • Multiple dialects (MySQL, PostgreSQL, more)
  • UPPERCASE / lowercase / preserve keywords
  • Clear clause indentation
  • Copy or download the result

Why use this tool

  • Review complex queries with ease
  • Standardize team SQL style
  • Spot joins and conditions at a glance

What is a SQL formatter?

A SQL formatter re-indents SQL statements so clauses like SELECT, FROM, WHERE, and JOIN line up clearly. It supports several database dialects so keywords and syntax are handled correctly — making long queries far easier to read, review, and debug.

Frequently Asked Questions

Which SQL dialects are supported?

Standard SQL plus MySQL, PostgreSQL, SQLite, MariaDB, and BigQuery — pick the one matching your database.

Can I keep keyword casing as I wrote it?

Yes — choose 'Preserve', or normalize keywords to UPPERCASE or lowercase.

Is it free and private?

Yes — it's 100% free with no signup, and everything runs locally in your browser, so your data is never uploaded to a server.