About this tool
Long concatenated SQL strings and single-line ORM logs are a pain to read and debug. Hand-indenting them is tedious and error-prone.
Powered by the widely-used sql-formatter library, DataFmt handles standard SQL, MySQL, PostgreSQL, SQLite, BigQuery and more. Tune keyword casing and indent width to match your team's style.
How to use
- Paste SQL into the input panel.
- Pick a dialect and keyword case (UPPER / lower / Preserve).
- Choose indent width (typically 2 or 4 spaces).
- Click "Format".
Use cases
- Audit slow-query logs to spot performance smells.
- Normalise hand-written SQL scattered across a codebase.
- Beautify ORM-logged SQL before pasting into docs or pull requests.
Notes
- This is a formatter, not an executor or validator.
- Dialect-specific syntax (window functions, CTEs, etc.) is supported.
- Comments are preserved.
Frequently Asked Questions
Does formatting change query semantics?
No. Only whitespace, indentation and keyword casing are modified; the parse tree is untouched.
Which dialects are supported?
Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, BigQuery, Db2, N1QL, PL/SQL, Redshift, Snowflake, Spark, TSQL, Trino and more.
Why are some function names not uppercased?
Only reserved keywords follow the casing policy. Function names are left as-is so that case-sensitive identifiers are not broken.