Developer Tools

SQL Formatter

Paste any SQL query and get it formatted with consistent indentation, keyword capitalisation, and line breaks, making even the most complex JOIN chains readable. Works entirely in your browser.

Runs in your browser No data sent to servers Copy or download result
sql SQL query
⌘↵
Runs in your browser; code never leaves your device

Features

  • Formats SELECT, INSERT, UPDATE, DELETE, CREATE
  • Indents JOIN clauses, WHERE conditions, subqueries
  • Keyword capitalisation (SELECT, FROM, WHERE)
  • Preserves string literals and comments
  • Copy or download formatted SQL

How to use it

  1. Paste your SQL query.
  2. Click Format.
  3. Formatted SQL appears in the output panel.
  4. Copy or download.

Use cases

  • Making minified SQL readable for debugging
  • Standardising SQL formatting in code reviews
  • Formatting exported SQL from ORMs or tools

Limitations

  • The formatter targets common SELECT, JOIN, WHERE, GROUP, ORDER, and VALUES clauses.
  • Very large input can be slower on older devices.
  • This utility is designed for common snippets and local inspection, not as a full security or language-specific validator.
Questions & answers

Frequently asked

Does it validate SQL syntax?

No. The formatter restructures whitespace and capitalisation without a parser. Syntax errors in the query are not detected.