
Convert CSV or TSV to JSON and back, with header detection, type casting and delimiter options.
Format SQL queries with uppercased keywords and clause line breaks.
Your files never leave your device. Everything runs in your browser.
SQL Formatter tidies SQL queries by uppercasing a fixed list of common keywords and placing the major clauses on their own lines. It is a quick way to make a one-line query readable before sharing it in a ticket, a document or a chat message.
The tokenizer is quote-aware: text inside single quotes, double quotes and backticks is left exactly as written, so words that look like keywords inside string literals are not changed. The formatter itself is intentionally simple and dialect-agnostic. It does not know MySQL from PostgreSQL, does not validate syntax, does not suggest indexes and never connects to a database.
A minify option collapses the query back to a single line with repeated spaces reduced, for pasting into a console or a configuration value.
select id, name from users where active = 1 produces SELECT on its own line, id and name on the next, then FROM, users, WHERE and the condition, with the keywords in uppercase.'select from where' stays lowercase because the tokenizer respects quotes.No. It applies one keyword list and one layout rule to every dialect. Dialect-specific syntax is preserved as text but is not recognised or reformatted.
No. It only rearranges whitespace and capitalisation. It does not parse the query grammar, check table or column names, or guarantee that the query will run.
The formatter breaks lines after single keywords, so two-word clauses are uppercased in place. Treat this as a known limit if you want fully expanded output.
Tokens are re-joined with spaces after formatting, so punctuation is separated from neighbouring tokens. It keeps the code valid but is not as polished as a dialect-aware formatter.
No. There is no database connection and no execution. The tool is a text formatter only, which also means it is safe to use with private schemas.
No. Formatting happens in your browser and the query never leaves the page.
Related convert tools: CSV ↔ JSON Converter, JSON Formatter, XML Formatter, HTML/CSS/JS Minifier.
SQL is formatted locally in the browser — your queries are never sent to a server.