SQL Formatter — Keyword Uppercase & Indent
Format SQL with uppercase keywords and consistent indentation. Free online SQL beautifier—runs in your browser, no upload.
How it works
- Pastes are formatted locally with uppercase SQL keywords and 2-space indentation. Dialect quirks may need a quick manual tweak.
About SQL formatting
What does an SQL formatter do?
An SQL formatter (SQL beautifier) rewrites queries with consistent indentation and keyword casing so SELECT, JOIN, and WHERE clauses are easier to read in reviews and tickets.
This page uses a vendored MIT copy of sql-formatter in your browser. Nothing is uploaded. Output prefers uppercase keywords and standard indentation.
Format SQL in code
- JavaScript
import { format } from "sql-formatter"; format(sql, { language: "sql", keywordCase: "upper" });- Python
# pip install sqlparse import sqlparse sqlparse.format(sql, reindent=True, keyword_case="upper")
SQL formatter FAQ
- Which SQL dialects are supported?
- Formatting targets standard SQL. Many common dialects format cleanly; vendor-specific extensions may need minor edits afterward.
- Are keywords uppercased?
- Yes. Keywords such as SELECT, FROM, and WHERE are uppercased while identifiers keep their original casing when possible.
- Is my query uploaded?
- No. Formatting runs locally with a vendored library. Your SQL never leaves the browser.