SQLite Formatter
Beautify SQLite queries and schema files for mobile apps, embedded databases and local tools.
SQL
Formatted SQL
Your SQL is processed in this browser tab and never uploaded.
How to use the SQLite Formatter
- Paste your SQLite query into the editor, or press Sample to load an example.
- The SQLite dialect is already selected, so dialect-specific syntax is parsed correctly.
- Press Format (Ctrl + Enter). Pick indentation and keyword case in the options.
- Copy the result or download it as a .sql file.
Example
Input
create table if not exists notes (id integer primary key, title text not null, body text, updated_at integer default (unixepoch())) strict; insert into notes (id, title) values (1, 'Hello') on conflict (id) do update set title = excluded.title;SQLite syntax this formatter understands
- CREATE TABLE statements with WITHOUT ROWID and STRICT table options are supported.
- UPSERT clauses (ON CONFLICT ... DO UPDATE) are laid out as their own block.
- SQLite JSON functions such as json_extract and the -> and ->> operators are kept intact.
- Identifiers quoted with double quotes, backticks or square brackets are all preserved.
What it does
- SQLite-aware parsing
- Uses the SQLite grammar from the open-source sql-formatter library, so syntax that is specific to SQLite is handled correctly.
- Keyword case control
- Keep the original case, or convert all keywords to UPPERCASE or lowercase as you format.
- Private by design
- Formatting happens on your device. Nothing you paste leaves the browser.
Frequently asked questions
Is my SQLite query sent to a server?
No. The formatter runs entirely in your browser. Your query is never uploaded, logged or stored, so it is safe to paste production SQL.
Will formatting change what my query does?
No. Only whitespace, line breaks and (if you choose) keyword case change. String literals, quoted identifiers and comments are kept exactly as written.
Does it validate my query?
The formatter has to parse your query, so badly broken SQL produces an error with its location. It does not check that tables or columns exist, and some invalid queries still format.