SQL Formatter

Turn a one-line SQL query into something you can read.

  • Free, no sign-up
  • Runs in your browser

Drop your file here, or

TXT, CSV, JSON, Markdown, HTML, XML, DOCX, PDF, RTF and more

Type, paste with Ctrl V, or drop a file

Options

Keywords
Indentation

or press Ctrl EnterRuns in your browser

Result

Your result will appear here.

Add your text, then press Format SQL.

How to use SQL Formatter

  1. Paste your text into the input box, or drop a file onto it.
  2. Choose your options.
  3. Press Format SQL.
  4. Copy the result or download it in the format you need.

Example

Before
select id, name from users where active = 1 order by name
After
SELECT
  id,
  name
FROM users
WHERE active = 1
ORDER BY name

Keywords uppercased, clauses on new lines.

Good for

  • Reading queries copied from logs or ORMs
  • Preparing SQL for code review
  • Making long reports maintainable

What happens to your text

Your text is processed in your browser and kept only in this tab’s memory. It is not uploaded, saved or used for analytics.

Questions about SQL Formatter

More answers in the TextVix FAQ.

Which SQL dialects are supported?

The formatter works with standard SQL used by MySQL, PostgreSQL, SQLite and SQL Server. It lays out queries but doesn’t check that they are valid.

Is my text uploaded anywhere?

No. This tool runs entirely in your browser. Your text and files are never sent to a server or stored.