inyourbrowser.com

Format SQL online

Format any SQL query with proper indentation and consistent keyword casing. Paste minified or messy SQL and get a clean, readable version back. Supports multiple SQL dialects.

Dialect:

Formatting runs entirely in your browser.

How it works

The tool uses the sql-formatter library, a dialect-aware SQL pretty-printer that runs entirely in your browser. It parses your query and re-emits it with consistent indentation and capitalisation.

Example

Input

update t set a = 1 where id = 7; delete from t where a is null;

Formatted

UPDATE t
SET
  a = 1
WHERE
  id = 7;

DELETE FROM t
WHERE
  a IS NULL;

Processing runs in your browser

All formatting happens locally in your browser tab. Our servers are not involved at any point.

Related operations

For inspecting JSON returned by queries, try the JSON formatter. To validate identifier patterns in your SQL, use the regex tester. For converting query results into structured rows, see CSV to JSON.

Frequently asked questions

How do I format a MySQL query?
Click the 'MySQL' dialect button, paste your query, and click Format SQL. The formatter will apply MySQL-appropriate keyword casing and indentation.
Can I format multiple SQL statements at once?
Yes. Paste multiple statements (separated by semicolons) and all will be formatted together.
Does the formatter fix SQL errors?
The formatter only adjusts whitespace and keyword casing and does not fix errors. If it cannot parse your SQL, it reports the line and column where parsing failed instead of formatted output.
Are comments kept?
Line comments (--) and block comments (/* */) stay in the output beside the code they annotate: -- active users stays on its own line above the formatted SELECT.

Last reviewed September 30, 2026

Other pages for this tool

Related tools

Regex tester
Test regular expressions with a live match list, replace, and split modes. Runs in your browser.
YAML formatter
Format, validate, and convert YAML. Compatible with Kubernetes, CI configs, and OpenAPI files.
JSON formatter
Pretty-print, minify, validate, and sort JSON keys. Instant output.