SQLFormatter
FormatterConvertPricingDocsGet Pro
Formatter & beautifier · SQLite

Format & beautify SQLite SQL online

Format and beautify SQLite SQL: consistent indentation, aligned clauses, uppercase keywords — and minified one-liners expanded back into readable code.

1Paste your SQLite query into the editor.
2Press Format — or ⌘↵.
3Copy clean, highlighted SQL.
Open formatter
before
select id,title,strftime('%Y',created_at) as yr from notes where deleted=0 and title like '%todo%' order by created_at desc limit 100;
SQLite
SELECT
  id,
  title,
  strftime('%Y', created_at) AS yr
FROM
  notes
WHERE
  deleted = 0
  AND title like '%todo%'
ORDER BY
  created_at DESC
LIMIT
  100;

Why format SQLite?

SQLite's grammar is compact but has its own quirks — AUTOINCREMENT, flexible typing, and functions like strftime and json_extract. The formatter formats to SQLite's rules so these read cleanly.

Great for the ad-hoc queries you run against a local .db file or an app's embedded database.

Beautify minified SQLite SQL

SQLite powers apps and scripts, so its queries often get generated inline and logged as one string. Beautifying that minified SQL into indented lines makes it readable without pulling it into a heavyweight tool.

Because SQLite is untyped and forgiving, a readable layout is your main defence against silently wrong logic — you can see the json_extract paths and subqueries clearly.

minified
SELECT n.id,n.title,(SELECT count(*) FROM tags t WHERE t.note_id=n.id)tags FROM notes n WHERE n.deleted=0 AND json_extract(n.meta,'$.pinned')=1 ORDER BY n.updated_at DESC LIMIT 50;
SQLite · beautified
SELECT
  n.id,
  n.title,
  (
    SELECT
      count(*)
    FROM
      tags t
    WHERE
      t.note_id = n.id
  ) tags
FROM
  notes n
WHERE
  n.deleted = 0
  AND json_extract(n.meta, '$.pinned') = 1
ORDER BY
  n.updated_at DESC
LIMIT
  50;

Frequently asked questions

Does the formatter understand SQLite-specific syntax?

Yes. The query is parsed against SQLite grammar rather than generic SQL, so SQLite-only constructs survive formatting: Flexible typing, strftime, json_extract.

What is the difference between formatting and beautifying SQLite SQL?

Nothing — they are two names for the same operation. "Format" usually describes tidying SQL you wrote yourself; "beautify" usually describes expanding a minified or ORM-generated one-liner into readable lines. This page does both, with a worked example of each above.

Is my SQL uploaded anywhere?

No. Formatting runs entirely in your browser — the query never leaves your machine and nothing is stored on a server.

Is the SQLite formatter free?

Yes: free, no account, no usage limit. Only the optional AI features — explain, optimize and dialect conversion — require signing in.

All SQL formatters & beautifiers

Format PostgreSQLFormat MySQLFormat T-SQLFormat SQLiteFormat BigQueryFormat OracleFormat SnowflakeFormat Redshift