SQL formatter
Pretty-print SQL queries — PostgreSQL, MySQL, SQLite, BigQuery and standard SQL — privately in your browser.
About the SQL formatter
Handytool's SQL formatter pretty-prints any SQL query — SELECT, INSERT, complex CTEs, window functions — using the popular sql-formatter library. Pick the dialect (PostgreSQL, MySQL, SQLite, BigQuery, or standard SQL), choose how keywords should be cased, and set the indentation. Everything runs locally, so it's safe to format queries that contain table names, column names, or sample data you'd rather not paste into a third-party site.
SQL formatter features
- 01
Dialect-aware
Each supported dialect has its own keyword list and reserved-word handling, so PostgreSQL's RETURNING, MySQL's backticks, and BigQuery's STRUCT syntax are all recognised correctly.
- 02
Keyword case control
Force ALL CAPS, all lowercase, or preserve what the input uses. The most common house style is upper-case keywords, which is the default.
- 03
Configurable indent
Choose 2 spaces, 4 spaces, or tabs. The output is consistent across CTEs, subqueries, and JOIN clauses.
SQL formatter FAQ
- Which SQL dialects are supported?
- Standard SQL (sql), PostgreSQL, MySQL, SQLite, and BigQuery. The underlying engine supports more dialects internally — these are the most useful for day-to-day work.
- Will it run my query?
- No. The formatter only re-renders the SQL text — it does not connect to any database, parse data, or execute statements.
- Why does my non-standard syntax format oddly?
- Vendor-specific extensions outside the chosen dialect (procedural blocks, stored-procedure syntax, MS SQL hints) may not lay out cleanly. Switch to the closest dialect, or paste shorter snippets at a time.
- Is my SQL uploaded anywhere?
- No. The sql-formatter library runs entirely in your browser — your queries stay on your device.
Related tools
Developer →- Live
YAML formatter
Format and validate YAML, or convert between YAML and JSON — privately in your browser.
DeveloperFreeRuns locallyOpen - Live
XML formatter
Pretty-print, minify, and validate XML — entirely in your browser.
DeveloperFreeRuns locallyOpen - Live
GraphQL formatter
Pretty-print and validate GraphQL queries, mutations, and schemas — privately in your browser.
DeveloperFreeRuns locallyOpen
Explore other tools
All tools →- Live
PDF to JPG
Convert each page of a PDF into a sharp JPG, PNG, or WebP image right in your browser — no upload, no quality loss.
PDFFreeRuns locallyOpen - Live
Remove background
Erase the background of a photo using an in-browser AI model — no upload, your images stay on your device.
ImageFreeRuns locallyOpen - Live
Trim Video
Cut the start or end of a video with frame-level precision.
VideoFreeOpen - Live
Trim audio
Cut a section of an audio file.
AudioFreeRuns locallyOpen - Live
Markdown to HTML
Convert Markdown into clean HTML right in your browser.
DocumentFreeRuns locallyOpen