Your data is never sent to a server or stored anywhere. All processing happens in your browser.

SQL Formatter

Keywords
Indent
Formatted SQL
 

How to Use


  1. Paste or type your SQL query in the input area.
  2. The formatted output updates in real time.
  3. Choose keyword casing: UPPER, lower, or preserve original case.
  4. Adjust indentation (2 or 4 spaces).
  5. Copy the formatted SQL with the copy button.

SQL Formatting


SQL formatting adds consistent indentation and line breaks to make queries readable. Major clauses (SELECT, FROM, WHERE, JOIN, etc.) start on new lines, and comma-separated items are aligned. This makes complex queries much easier to understand, debug, and review.

Supported Statements


  • SELECT queries with JOINs, subqueries, GROUP BY, ORDER BY, HAVING, LIMIT
  • INSERT INTO ... VALUES
  • UPDATE ... SET ... WHERE
  • DELETE FROM ... WHERE
  • CREATE TABLE, ALTER TABLE, DROP TABLE
  • Comments (-- single line)

Privacy


All formatting happens in your browser. No data is sent to any server.