SQLite Formatter

Paste a SQLite query and get it laid out clause by clause — with SQLite syntax handled correctly.

Input · drop a file

Output

SQLite-specific syntax this formatter understands

  • ?, ?1 and :name parameters are preserved
  • INSERT OR REPLACE and UPSERT (ON CONFLICT) format correctly
  • Functions like json_extract and datetime keep their arguments together
  • Square-bracket and backtick identifiers are accepted, as SQLite allows

Formatting changes only whitespace and keyword case. What the query does is unchanged. Need another database? The main SQL formatter has 11 dialects, and the SQL minifier squeezes a query onto one line.

Questions

Is this SQLite formatter free and private?

Yes. It runs in your browser using the open-source sql-formatter library; your query is never uploaded.

Can I format a whole .sql schema dump?

Yes — open the file; each statement is separated by a blank line.

Does it check my query against my schema?

No — it understands the syntax, not your tables. A nicely formatted query can still reference a column that doesn’t exist.

Related tools