Hire me

SQL Formatter

Make long, one-line SQL queries readable with proper line breaks, indentation and keyword case.

  • Free, no sign-up
  • Code stays in your browser
  • Works on phone and desktop

Paste a SQL query and the formatter (sql-formatter library) puts each clause on its own line, indents joins and conditions, and applies your preferred keyword case for MySQL, PostgreSQL, SQL Server and other dialects.

How to format SQL

  1. Choose your database dialect.
  2. Paste the query.
  3. Copy the formatted SQL.

Why format SQL?

Formatted queries are easier to review, debug and compare in version control. Logs and ORMs usually output queries on a single line.

Frequently asked questions

Does it run my query?

No. It only reformats text. Nothing connects to a database.

Updated October 2026 · Built and tested by Sharjeel Tahir · How our tools are tested