← All tools
Free tool
SQL Formatter
Paste messy SQL and get clean, consistently formatted PostgreSQL in seconds. Keyword casing, smart indenting, copy or download. Free, no signup, private.
Keywords:
Indent:
PostgreSQLinput.sql · 1 line
formatted.sql · 1 → 15 lines
SELECT u.email, count(p.id) AS post_count FROM users u LEFT JOIN posts p ON p.user_id = u.id WHERE u.created_at > now() - interval '30 days' AND p.published = TRUE GROUP BY u.email ORDER BY post_count DESC LIMIT 20;
Why format your SQL
- Readable diffs: formatted migrations produce clean pull-request diffs instead of single-line noise
- Faster debugging: a misplaced JOIN or WHERE is obvious when every clause starts on its own line
- Team consistency: one style for every query, enforced in seconds rather than by convention docs nobody reads
- Log triage: paste a 400-character query from your app logs and actually read it
Frequently asked questions
Related tools
PostgreSQL ER Diagram →
Paste a connection string or SQL and explore tables and foreign keys.
Schema Health Analyzer →
Find missing primary keys, orphan tables, and schema issues.
CSV to SQL →
Turn a CSV file into CREATE TABLE and INSERT statements.
JSON to SQL →
Convert JSON objects into PostgreSQL tables and rows.
SQL Validator →
Check PostgreSQL syntax and catch errors before running it.
SQL to Mermaid →
Generate a Mermaid ER diagram from CREATE TABLE statements.
SQL to TypeScript →
Generate TypeScript types and Zod schemas from tables.
SQL to Prisma →
Convert PostgreSQL tables into a Prisma schema.
Connection String Builder →
Build, parse, and debug PostgreSQL connection strings.
Schema Diff →
Compare two schemas and get the ALTER statements to sync them.
DBML to SQL →
Convert DBML diagrams into PostgreSQL DDL.
Prisma ERD →
Visualize a Prisma schema as an entity-relationship diagram.
PR Schema Diff Action →
Post schema changes and ER diagrams on every pull request.
Formatted your schema? See it as a diagram
Paste your PostgreSQL connection string and get an interactive ER diagram in under 10 seconds. No signup required.
Try it free →