Help
  • If formatting fails, try switching the SQL dialect at the top left, or check the statement for syntax errors

SQL Formatter

This free online SQL formatter beautifies SQL statements with proper indentation and uppercased keywords — and can minify them back down to a single line.

All tools on this site run entirely in your browser locally. No data is uploaded to any server.

Features:

  • Beautify: Re-indent SQL with consistent spacing and uppercased keywords
  • Minify: Strip whitespace and line breaks, compressing everything into a single line
  • Dialects: Supports MySQL, PostgreSQL, Oracle PL/SQL, SQL Server T-SQL, Hive, Snowflake and more

Common uses:

  • Cleaning up unformatted SQL for easier reading and debugging
  • Compressing SQL to reduce transfer size
  • Reformatting queries copied from logs or generated code