SQL Formatter
Format MySQL, PostgreSQL and T-SQL with configurable indentation.
This SQL formatter online free tool turns messy, single-line or inconsistently indented SQL into clean, readable queries. Paste a SELECT, INSERT, UPDATE or a long stored procedure and get consistent line breaks, indentation and keyword layout back in one click. Readable SQL is easier to review in a pull request, debug when a join returns the wrong rows, and share with a teammate who has to maintain it later. Use it before committing a query to a repository, before pasting a query into documentation, or when you copy generated SQL from an ORM log and cannot read it. Everything runs in your browser. Your queries are never uploaded, never stored on a server and never tied to an account, which matters when the SQL contains table names, column names or literal values from a real database. Once the page has loaded it keeps working offline, so you can format queries on a plane or behind a locked-down network. It is free, with no sign-up and no usage limits.
Frequently asked
Is this SQL formatter online free to use?
Yes. It is free, needs no account and has no daily limit. It runs in your browser, so there is nothing to install.
Is my SQL sent to a server?
No. Formatting happens locally in your browser tab, and your query never leaves your device. The tool also works offline after the page has loaded.
Can I use this instead of a SQL formatter for VSCode or SSMS?
It is a quick alternative when you do not want to install an extension. Paste your query, copy the formatted result and paste it back into VSCode, SSMS or Notepad++.
Is there a SQL formatter CLI version?
This page is a browser tool, not a command line program. If you need a CLI for build pipelines, use a separate command line formatter and keep this tool for quick manual cleanup.
More Format & Dev tools
- JSON FormatterFormat, validate, minify and explore JSON — handles huge inputs without freezing the tab.
- Markdown PreviewRender Markdown live with GFM support and copy as clean HTML.
- Base64 Encode / DecodeEncode and decode Base64 text and files in your browser.
- JWT DecoderInspect JWT header, payload and expiry — tokens never leave the page.
- Regex TesterTest regular expressions live with match highlighting and capture groups.
- Diff CheckerCompare two texts and see additions and removals line by line.
- Cron BuilderBuild cron expressions and read them back in plain English.