# SQL Formatter

> Pretty-print SQL for Postgres, MySQL and more. Runs entirely in your browser — nothing you paste is sent anywhere.

Source: https://toffeekit.com/tools/sql-formatter

**Category:** [Developer](https://toffeekit.com/category/developer) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/sql-formatter

**Also useful for:** sql, format, beautify, query

## How it works

1. Paste your query into the Input box, or click Sample.
2. Pick a Dialect: SQL, Postgres, MySQL, SQLite or SQL Server.
3. Switch UPPERCASE on or off to control the case of keywords.
4. Click Copy or Save to keep the formatted query as query.sql.

## FAQ

### How do I format a SQL query?

Paste the query and the formatted version appears on the right, with each clause on its own line and joins and conditions indented.

### Does the dialect setting matter?

Yes. It tells the formatter which keywords, quoting and functions to expect, so PostgreSQL features like ILIKE or MySQL backtick names are handled correctly.

### Can I get lowercase SQL keywords?

Turn off the UPPERCASE switch. Keywords such as select and from are then written in lowercase.

### Does formatting change what my query does?

No. Only whitespace and keyword case change. Identifiers, strings and values are left as you wrote them.

### Why do I get a formatting error?

The formatter could not parse part of the query, often an unbalanced parenthesis or an unclosed quote. The message shows where it stopped.

### Is SQL Formatter free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

SQL Formatter runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [JSON Formatter](https://toffeekit.com/tools/json-formatter) — Format, minify and validate JSON with clear errors.
- [Base64 Encode / Decode](https://toffeekit.com/tools/base64-encoder) — Encode text to Base64 or decode it back, UTF-8 safe.
- [URL Encode / Decode](https://toffeekit.com/tools/url-encoder) — Percent-encode query values or whole URLs.
- [HTML Entities](https://toffeekit.com/tools/html-entity-encoder) — Escape < > & and quotes, or decode entities.
- [JWT Decoder](https://toffeekit.com/tools/jwt-decoder) — Read a token's header, claims and expiry.
- [Hash Generator](https://toffeekit.com/tools/hash-generator) — MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once.

