# SQL Formatter

Canonical URL: https://offlineutils.com/sql-formatter
Category: Developer
Published: 2026-07-02
Publisher: offlineutils.com
Runs entirely in the browser; nothing entered into the tool is uploaded.

> A SQL Formatter reformats a raw SQL query into clean, consistently indented SQL — with configurable dialect, keyword casing, and indentation — entirely in your browser, so queries never leave your machine.

Paste a cramped one-line query and get readable, indented SQL back instantly. Choose the dialect (Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server/T-SQL, or BigQuery), whether keywords are uppercased, lowercased, or preserved, and 2- or 4-space indentation. Formatting is powered by the sql-formatter library running locally — your queries, which often contain schema and data details, are never uploaded.

## Features

- Formats 7 dialects (Standard, PostgreSQL, MySQL, MariaDB, SQLite, T-SQL, BigQuery)
- Uppercase, lowercase, or preserve keyword casing
- 2- or 4-space indentation
- Live formatting as you type
- Copy the formatted query with one click
- Runs entirely in your browser — queries never uploaded

## Use cases

- Making a minified or generated query readable for review
- Standardizing SQL style before committing to version control
- Understanding an unfamiliar query's structure
- Cleaning up SQL pasted from logs or an ORM

## How to use it

1. **Paste SQL** — Paste your query into the input pane.
2. **Set options** — Choose dialect, keyword case, and indentation.
3. **Copy** — Copy the formatted SQL from the output pane.

## When to use it, and when to use something else

- **vs Online SQL beautifiers** — use SQL Formatter when your query contains sensitive schema or data and you refuse to paste it into a third-party server. Use Online SQL beautifiers when you need dialect-specific linting beyond formatting.
- **vs An IDE format command** — use SQL Formatter when you want a quick format on any device without opening the project. Use An IDE format command when you're already in the IDE and it's configured.

## Frequently asked questions

### Which SQL dialects are supported?

Standard SQL, PostgreSQL, MySQL, MariaDB, SQLite, SQL Server (T-SQL), and BigQuery. Pick the one matching your database so dialect-specific syntax is formatted correctly.

### Does formatting change what my query does?

No. Formatting only adjusts whitespace, line breaks, and keyword casing — the query's logic and identifiers are untouched.

### Are my queries sent to a server?

No. Formatting runs in your browser via the sql-formatter library. Your SQL, which often reveals schema and data, never leaves your device.

### Can it uppercase keywords like SELECT and FROM?

Yes. Set keyword casing to UPPERCASE (the default), lowercase, or preserve to keep whatever you typed.

## Related tools

- https://offlineutils.com/json-formatter
- https://offlineutils.com/yaml-to-json
- https://offlineutils.com/csv-json
