SQL Formatter

Input SQL
Formatted output
Formatted SQL will appear here.

About SQL Formatter

A local browser workbench for SQL formatting

The online SQL formatter helps normalize SQL before debugging, sharing, or committing it. It runs entirely in the browser, supporting custom indentation, keyword casing, and line break strategy. SQL content always stays on your device.


Features

  • Format SQL with custom indent style (2 spaces, 4 spaces, tab)
  • Convert keywords to UPPER, lower, or preserve original case
  • Minify SQL to single line by removing excess whitespace
  • Supports standard SQL with awareness of common dialect quirks
  • Syntax-highlighted output for formatted SQL

How to use

  1. 1 Paste the SQL you want to format
  2. 2 Adjust indent, keyword case, and line break options
  3. 3 Click Format for beautified output or Minify for single-line output
  4. 4 Copy the result to your clipboard

FAQ

Is my SQL uploaded to a server?
No. Formatting runs locally in your browser, so the SQL does not leave your device.
What SQL dialects are supported?
Standard SQL by default, with automatic awareness of common dialect features like MySQL backticks and PostgreSQL dollar-quoted strings.
What if formatting fails?
Check that the SQL syntax is correct. The formatter shows error messages to help locate the issue.
Can formatting preferences be saved?
Yes. Indent, keyword case, and line break options are saved in localStorage for this browser.
What is the difference between format and minify?
Format beautifies indentation for readability. Minify removes all extra whitespace to produce a single-line SQL.

Related Tools