How to use SQL Formatter
- Paste your SQL.
- Choose keyword case and indentation.
- Copy or download the formatted SQL.
Supported features and limitations
A lightweight formatter: it does not validate SQL or understand every dialect, and unusual syntax (procedures, vendor extensions) may format imperfectly. Strings and comments are kept as written.
Privacy
Everything you type is processed locally in your browser and is not sent to our servers. No account is needed and there is no watermark.
Frequently asked questions
Does it change what my query does?
It only changes whitespace and keyword case.
Does it work for MySQL and PostgreSQL?
Common SELECT, INSERT, UPDATE and DELETE statements work across dialects.
Related tools
- CSV to SQL INSERT Generator - Turn CSV data into SQL CREATE TABLE and INSERT statements for PostgreSQL, MySQL, SQLite and others.
- JSON Formatter & Validator - Format, minify and validate JSON with clear errors.
- HTML Formatter - Indent and beautify HTML so nested tags are easy to read.
- String Escape & Unescape Tool - Escape or unescape text for JSON strings, JavaScript or Java single-quoted strings, SQL string literals and regular expressions.
- URL Encoder / Decoder - Encode or decode URLs and query strings.
- Color Converter - Convert between HEX, RGB and HSL colours.