Skip to content
clkr

Loading tools…

    SQL Formatter

    Format and beautify SQL queries with this free online SQL formatter: clean line breaks, indentation and uppercase keywords, or minify to one line.

    Loading…
    Processed locally in your browserHow?

    This tool runs in this browser tab. The files, text and values you enter are not uploaded to clkr.work servers — closing the tab clears them. Anonymous usage events (such as which button was pressed) are counted, never your content. Privacy policy

    What next?

    Found it useful? Share SQL Formatter

    Free, no sign-up, works in the browser — send it to a friend or add it to your site.

    Part of the toolkit

    How to use SQL Formatter

    1. 1Paste your SQL query into the input box
    2. 2Choose Beautify (with indent size and keyword case) or Minify
    3. 3Copy the formatted SQL or download it as a .sql file

    Frequently asked questions

    Which SQL dialects are supported?▾

    The formatter works on standard SQL shared by MySQL, PostgreSQL, SQL Server, SQLite and Oracle — including backtick, double-quote and [bracket] identifiers, :: casts and -- or /* */ comments.

    Can formatting break my query?▾

    No. Only whitespace and the letter case of keywords change. String literals, identifiers, numbers and comments are copied exactly, so the query means the same thing.

    How are subqueries and joins laid out?▾

    Each clause (SELECT, FROM, JOIN, WHERE, GROUP BY…) starts on its own line, select columns go one per line, AND/OR conditions break onto new lines and subqueries are indented inside their parentheses.

    What does minify do?▾

    It removes comments and collapses the query onto a single line with minimal spaces — handy for logs, config files or embedding SQL in code.

    Embed SQL Formatter on your website▾

    Paste this snippet into your page. The embedded tool runs in your visitor's browser and shows a small “Powered by clkr.work” link.