Skip to content

Developer tools

SQL Formatter

Turn long one-line queries from logs or ORMs into readable SQL with consistent indentation and keyword case.


            
        

How to use the SQL Formatter

  1. 1

    Paste one or more SQL queries.

  2. 2

    Choose the database dialect, keyword case and indentation.

  3. 3

    Copy the formatted SQL or download it as a file.

Frequently asked questions

Does it run my queries?

No. It only reformats the text in your browser; it never connects to a database.

How do I see the SQL Laravel runs?

Call ->toRawSql() on a query builder (Laravel 10.15+), or use DB::listen / Laravel Telescope, then paste the query here.

Embed this tool on your site

Paste this code into your page. It's free, with no sign-up, ads or cookies.

Preview

Please keep the "Powered by Dev-Talk" link.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.