🗃️ Developer Tools

SQL Formatter

Beautify messy SQL into clean, readable queries — or minify to one line. Private, in your browser.

SQL input
Formatted
Overview

SQL Formatter: turn a wall of SQL into readable queries

SQL that arrives as one giant line — copied from a log, an ORM, or a colleague — is painful to read and easy to misread. This formatter reflows it into a clean, conventional layout: keywords uppercased, each major clause (SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY) on its own line, conditions and columns broken out so the structure of the query is obvious at a glance. It also does the reverse, minifying a formatted query back to a single compact line for embedding in code.

It runs entirely in your browser and is careful with string literals — text inside quotes is never reformatted or uppercased — so your queries and any embedded data never leave your device. It is a fast way to make sense of an unfamiliar query or tidy your own before committing it.

100% freeNo sign-upFormat & minifyRuns in your browser
How to use it
  1. 1Paste your SQL into the input box (or load the sample).
  2. 2Press Format to beautify it into readable, indented SQL.
  3. 3Press Minify to collapse a query onto a single line.
  4. 4Copy the result with one click.
Key features
  • Beautifies SELECT, INSERT, UPDATE and DELETE statements
  • Uppercases keywords and breaks clauses onto their own lines
  • Indents AND/OR conditions and lists columns clearly
  • One-click minify back to a single line
  • String literals are preserved exactly — never reformatted
  • 100% client-side — your SQL never leaves your device

Frequently asked questions

Does it change what my query does?
No. Formatting only adds or removes whitespace and adjusts keyword casing; it never alters the logic of your SQL. The query runs identically before and after.
Which SQL dialects are supported?
It handles standard SQL used by MySQL, PostgreSQL, SQL Server, SQLite and others. Very dialect-specific syntax may format less perfectly, but common queries reflow cleanly.
Will it uppercase my column names?
It uppercases recognised SQL keywords only. A column that happens to share a keyword name (like 'order') may be uppercased; rename or quote such identifiers if that matters.
Is my SQL uploaded?
No. All formatting happens in your browser with JavaScript; nothing is sent to a server.