SQL Formatter
Beautify messy SQL queries with consistent indentation and keyword case for MySQL, PostgreSQL, SQL Server, SQLite and more.
Runs on your device
Result
Results appear here as you type.
What it does
Paste a one line query from a log or ORM and get readable, indented SQL. Formatting uses the open source sql-formatter library and never runs the query.
How to use it
- Paste your SQL.
- Choose the dialect and keyword case.
- Copy the formatted query.
Example
The example fills in realistic values and runs the tool. Select Try an example above to see it.
When it helps
- Reading ORM-generated queries.
- Code reviews.
- Documentation and Stack Overflow questions.
Questions
Does it validate SQL?
It formats valid syntax and reports what it cannot parse, but it does not check tables or columns.
Is my query sent to a database?
No. Nothing is executed or uploaded.
More developer tools
See all 25- CSS Gradient Generator Build linear and radial CSS gradients from up to five colours, preview them, and copy ready to use CSS for backgrounds and buttons.
- HTTP Status Code Lookup Look up what any HTTP status code means, from 200 OK and 301 redirects to 404, 429 and 503, with practical notes for debugging.
- User Agent Parser Parse a browser user agent string into browser, version, operating system, rendering engine and device type. Shows your own by default.
- XML Formatter & Validator Pretty print and validate XML for sitemaps, RSS feeds, SOAP and config files, with clear well formedness errors. Parsed safely, never executed.
- Password Strength Checker Check how strong a password is with an entropy estimate, common password and pattern detection, and an estimated offline cracking time.
- JSON Formatter & Validator Format, validate, minify or key sort JSON with clear error messages. Runs in your browser, so API responses and configs never leave your device.
People also use
Browse all 200 tools- Online Screen Recorder Record your screen, a window or a browser tab with optional microphone audio, then preview and download the video. No install, no watermark. Media & files
- Watermark PDF Add a text watermark such as CONFIDENTIAL or DRAFT across every page of a PDF, with control over size, colour, opacity and angle. PDF
- AWG Wire Gauge Calculator Convert American Wire Gauge (AWG 0000 to 40) to diameter, cross sectional area in mm² and copper resistance per kilometre, plus voltage drop for a run. Electrical & engineering
- Microphone Test Test your microphone online in seconds: see a live level meter, choose between microphones, and play back a short recording to hear yourself. Device tests