SQL Formatter

Format SQL queries with readable indentation and line breaks, making SELECT, JOIN, WHERE, and INSERT statements easier to review.

How to Use

  1. Paste your SQL into the input area (even single-line queries generated by an ORM like Prisma or Hibernate)
  2. Choose the indent width: 2 spaces for pasting into Slack or Notion; 4 spaces for code review on GitHub or GitLab
  3. Click "Format SQL" β€” everything runs in your browser, no SQL is sent to an external server
  4. The result splits SELECT, FROM, JOIN, WHERE, GROUP BY, and ORDER BY onto separate lines with consistent indentation for subqueries and CTEs
  5. Copy the result to your clipboard and paste it into DBeaver, DataGrip, pgAdmin, Navicat, or a Jira ticket
  6. Take the formatted query into `EXPLAIN ANALYZE` on your database to spot bottlenecks in BI reports or ETL pipelines

All processing is done in your browser, and files are never sent to a server.

Frequently Asked Questions

The formatter supports standard SQL syntax that works with MySQL, PostgreSQL, SQL Server, and other major databases.
No, formatting only adds indentation and line breaks for readability. The query logic remains unchanged.
Yes, it handles JOINs, subqueries, CTEs, and other complex SQL structures.
Yes. UTF-8 comments and quoted string literals (CJK, Cyrillic, accents) are preserved verbatim.
No. Formatting runs locally in your browser β€” safe for production queries containing column names or business logic.
Yes. Common Table Expressions, window functions, and recursive queries are all formatted with proper indentation.
Yes β€” pick 2 spaces, 4 spaces, or tabs to align with your style guide.
No. All operations are processed entirely inside your browser's local sandbox using client-side APIs (like WebAssembly, pdf-lib, or HTML5 Canvas). Your files and data never leave your device.
The tool is completely free with no usage limits. However, since processing occurs in your browser's memory, we recommend keeping file sizes under 50MB (especially for heavy files like PDFs or videos) to ensure stability.
No. All tools on ConvertBox are 100% free. We do not insert watermarks, limit features, or require any registration or payment.
Yes. Once the page and its local library dependencies are loaded in your browser, the conversion logic runs completely offline without needing an active internet connection.