Switch guideSQL editor & formatter

SQL EDITOR & FORMATTER

Keep SQL queries readable and ready for next time.

Use a browser SQL editor to draft a query, tidy its layout, and keep the explanation beside it. Blob Notebook saves SQL notes locally and offers a dialect chooser for the query you are editing.

Open editor

Free to use · No account needed · Saved in this browser

weekly-orders.sql SQL
SELECT customer_id, COUNT(*) AS orders
FROM orders
WHERE created_at >= '2026-01-01'
GROUP BY customer_id
HAVING COUNT(*) > 1
ORDER BY orders DESC;
A query draft for reviewing aggregation, filters, and ordering before running it in your database tool.Try this example

EDIT IN YOUR BROWSER

Your local draft

The notebook’s editing tools, right here. Save to notebook when you want a named copy.

Open full editor

Enable JavaScript to edit here, or open the full editor above. The example and guide are always available.

This draft is shared with the full editor for this task and stays separate from named notes. Export a copy or save to notebook to include it in a notebook backup. This editor page and its tools reopen offline after the editor reports readiness. Informational and privacy guides need a connection.

A FEW SIMPLE STEPS

Get started

  1. Create a note, choose SQL, and paste or type a query.
  2. Select the SQL dialect, or begin with Auto-Detect.
  3. Use Format in the code tools to make the query easier to inspect.
  4. Review the changes, save the note, and copy or download the query for your database client.

Open editor takes you to the draft on this page. Paste or open a source file, or choose Try this example. Save to notebook keeps a named copy with your notes. Your workspace style stays unchanged.

Choose a SQL dialect before formatting

Use Auto-Detect as a starting point, or select the database syntax you know you are writing. Options include PostgreSQL, MySQL, MariaDB, T-SQL for SQL Server, SQLite, Google BigQuery, Snowflake, Oracle PL/SQL, DuckDB, ClickHouse, Trino / Presto, Amazon Redshift, Spark SQL, Hive, DB2, SingleStoreDB, TiDB, Couchbase N1QL, and Standard SQL.

Choose upper, lower, or preserved keyword case before Format. Quoted identifiers, strings, and comments retain their case. Detection and fallback formatting are conveniences: review the result against your intended dialect before using it. To build an IN list from values, open Developer tools or select the values and use its right-click submenu.

Save a query and compare a revision

Keep recurring reports in separate tagged notes or save a reusable code snippet. Put an old query in Pane A and an edited query in Pane B to review changed lines before copying the result.

This is a SQL text editor and formatter. It does not connect to a database, execute a query, or verify its results. Run and test the final statement in your database environment.

Blob Notebook SQL source editor with a PostgreSQL query
The notebook with fictional sample notes. Open the image for a closer look.

A few questions

Can I format SQL without a database connection?

Yes. Formatting runs in the browser and needs no database credentials. After the app is ready for offline use, the formatter can also be used without a connection.

Does a formatted query mean the SQL is valid?

No. Formatting can fall back when a dialect parser cannot handle a statement. It is not a guarantee of valid syntax, safe execution, or correct results.