SQL Pretty Print

Break SQL into readable lines with clause-based line breaks and indentation.

Input data is processed in your browser
Data is never sent to a server

Tool

0 chars

What is SQL Pretty Print?

SQL Pretty Print breaks a single-line SQL query into readable lines at clauses such as SELECT, FROM, WHERE, and JOIN. It also supports automatic indentation for AND/OR conditions and switchable comma placement styles, improving readability for code review and documentation.

How to Use

  1. Paste an SQL query into the input field.
  2. Click "Format" to break it into lines at clauses like SELECT, FROM, and WHERE.
  3. Customize indent width, keyword casing, and comma placement.
  4. Click "Copy Result" to copy to clipboard.

FAQ

How is this different from SQL Formatter?

SQL Formatter is a full-featured tool supporting multiple DBMS dialects. SQL Pretty Print is a lightweight, dependency-free tool focused on simple clause-based line breaks and indentation.

What does "comma-first" mean?

It's a SQL style where, when wrapping a column list, each comma is placed at the start of the next line rather than the end of the previous one (e.g. ", name").

Are keywords inside string literals capitalized too?

No. Content inside single-quoted, double-quoted, and backtick-quoted strings is protected and left unchanged.

Is my data sent to a server?

No. All processing happens in your browser.