Blog
Wild & Free Tools

SQL Formatter for dbt Data Engineers — Format Models Before You Commit

Last updated: April 2026 7 min read

Table of Contents

  1. When sqlfluff is overkill
  2. Compatibility with sqlfluff defaults
  3. Format a dbt model — workflow
  4. Handling jinja templating
  5. When to use sqlfluff over the browser tool
  6. Related tools for dbt teams
  7. Frequently Asked Questions

dbt data engineers know about sqlfluff. It is the gold standard for dbt SQL formatting in CI pipelines. The catch: sqlfluff is a heavy install (Python package, dialect-specific dependencies, configuration file), and it is overkill for the moment when you are mid-flow writing a model and just want to clean up the query before committing it.

Our browser formatter handles the in-flight case. Format your dbt model, copy back into your editor, run dbt run to test, commit. Compatible enough with sqlfluff defaults that the CI pipeline does not flag your changes. Faster than launching sqlfluff for one model.

When sqlfluff Is Overkill — and When It Is Not

sqlfluff is the right call for these cases:

The browser tool is the right call for these cases:

Most dbt teams use both — sqlfluff in CI, browser tool for in-flight work.

Browser Formatter vs sqlfluff Defaults

The browser formatter and sqlfluff produce very similar output for most queries. Both follow these conventions:

Where they differ:

For most ad-hoc formatting, the browser tool produces output that sqlfluff would accept on the next CI run. If your team has highly customized sqlfluff rules, double-check after formatting.

How to Format a dbt Model in Your Browser

  1. Open your dbt model in your editor — VS Code, Cursor, vim, whatever you use.
  2. Copy the entire model — including the {{ config(...) }} block and any jinja.
  3. Paste into our formatter.
  4. Pick the dialect — match your warehouse: BigQuery, PostgreSQL (Redshift), Snowflake (use BigQuery), Standard (Databricks).
  5. Set indent to 2 spaces — the dbt convention.
  6. Toggle uppercase keywords on.
  7. Click Format. The SQL portions will be reformatted; jinja blocks will pass through as text.
  8. Copy and paste back into your model, replacing the original.
  9. Run dbt parse to verify the model still compiles correctly.
  10. Run dbt run --select your_model to verify execution.
  11. Commit and push — your CI pipeline running sqlfluff should accept it.
Sell Custom Apparel — We Handle Printing & Free Shipping

How the Formatter Handles dbt Jinja Templating

dbt models contain jinja blocks like:

The browser formatter does NOT interpret jinja. It treats jinja blocks as opaque text and formats around them. This means:

For models that are mostly SQL with light jinja (ref calls, source calls, occasional config), this works fine. For models that are heavily templated (entire query inside a {% for %} loop), use sqlfluff with the dbt plugin for proper handling.

When to Use sqlfluff Over the Browser Tool

For these specific cases, sqlfluff is the right call even though the browser tool is faster:

For everyone else, the browser tool is faster and covers 90% of cases.

Other Browser Tools for dbt Data Teams

dbt teams use a lot of tools. These browser tools cover the most common adjacent tasks:

YAML formatter — dbt schema.yml files use YAML. Use the YAML formatter to clean up source definitions.

JSON formatter — for inspecting JSON columns from your warehouse. JSON Formatter.

SQL diff checker — for reviewing PRs to dbt models, the SQL diff tool shows what changed.

Cron expression generator — for dbt Cloud schedule definitions. Cron Generator.

Try It Free — No Signup Required

Runs 100% in your browser. No data is collected, stored, or sent anywhere.

Open Free SQL Formatter

Frequently Asked Questions

Will the browser formatter break my dbt jinja templating?

No. Jinja blocks are passed through as opaque text. The formatter does not interpret {% if %}, {% for %}, {{ ref() }}, or any other jinja construct. Your templating is preserved exactly as written.

Is the output compatible with sqlfluff defaults?

For most queries, yes. Both tools default to uppercase keywords, 2-space indent, one column per line, and JOIN-on-own-line conventions. If your team has heavily customized sqlfluff rules, the browser output might not match — verify with a sqlfluff lint after pasting back.

Should I replace sqlfluff with this browser tool?

No — they serve different purposes. Use sqlfluff for CI enforcement, pre-commit hooks, and bulk formatting. Use the browser tool for in-flight ad-hoc formatting while you write models. Most teams use both.

Can I format a model that uses {% for %} loops with SQL inside?

Partially. The SQL outside the loop formats cleanly. The SQL inside the loop body is treated as part of the opaque jinja block and is not separately formatted. For heavily templated models, use sqlfluff with the dbt plugin.

Does the formatter work in Cursor or VS Code?

The formatter is a browser tool — it runs in a browser tab. Cursor and VS Code have their own SQL formatting extensions. Use the browser tool when you do not have an extension installed or when you want to format quickly without configuring an editor extension.

Launch Your Own Clothing Brand — No Inventory, No Risk