guide

How to Format SQL Without Uploading It (2026)

Last updated: 11 June 2026

To format SQL privately, open a browser-based SQL formatter and paste your query — formatting runs entirely in JavaScript, so nothing is transmitted to a server. Open DevTools → Network tab before pasting: a private formatter produces zero outbound requests. Most popular online SQL formatters send your query to a server for processing; brevio's SQL Formatter does not.

Step-by-step: format SQL without uploading

  1. Open DevTools (F12 → Network tab) and start recording — this lets you verify no data is sent.
  2. Navigate to brevio SQL Formatter and paste your query into the input area.
  3. The formatted output appears instantly: keywords uppercased, clauses on new lines, continuation lines indented.
  4. Check the Network tab — you should see zero requests to any external host while you were typing. All processing ran in your browser.
  5. Click Copy to paste the result directly into your SQL editor or query tool.

What the formatter does to your SQL

The formatter applies three transformations:

  • Keyword uppercasing — SELECT, FROM, WHERE, JOIN, GROUP BY, ORDER BY, and 50+ other SQL keywords are capitalised consistently.
  • Clause line breaks — Each major clause starts on a new line: SELECT, FROM, WHERE, INNER JOIN, LEFT JOIN, GROUP BY, HAVING, ORDER BY, LIMIT, UNION ALL.
  • Continuation indentation — Lines following a clause keyword are indented two spaces, making nested conditions and multi-column SELECT lists readable.

Quoted strings and comments are protected during transformation — their contents are never modified regardless of whether they contain SQL keywords.

Before and after example

Input (unformatted)

select u.id,u.name,o.total from users u inner join orders o on u.id=o.user_id where o.status='paid' and u.created_at>'2024-01-01' order by o.total desc limit 100

Output (formatted)

SELECT u.id, u.name, o.total
FROM users u
INNER JOIN orders o ON u.id = o.user_id
WHERE o.status = 'paid'
  AND u.created_at > '2024-01-01'
ORDER BY o.total DESC
LIMIT 100

SQL formatter comparison

ToolClient-sideAccount requiredNetwork request on paste
brevio SQL FormatterYesNoNone
sqlfiddle.comNoNoYes (query sent to server)
sqlformat.orgNoNoYes (POST request)
VS Code SQL formatter extensionYes (local app)NoNone
DataGrip built-in formatterYes (local app)Yes (IDE licence)None

When SQL privacy matters

Many SQL queries contain information that should not leave your organisation's network:

  • Queries with embedded credentials, API keys, or connection strings in comments
  • Queries against internal tables that reveal schema structure to a third party
  • Queries referencing PII columns (customer email, user ID, health records)
  • Queries from production database sessions that include sensitive WHERE clause values

For these cases, a server-side formatter represents an unnecessary risk. The correct tool runs formatting logic locally, as all JavaScript-based formatters do.

Format SQL from the command line

For CI pipelines or local scripting, sqlfluff is the leading open-source SQL linter and formatter. It runs entirely locally:

pip install sqlfluff
sqlfluff fix --dialect postgres my_query.sql

sqlfluff supports dialect-specific formatting for PostgreSQL, MySQL, BigQuery, Snowflake, and Spark SQL. For quick ad-hoc formatting, the browser tool is faster; for repository-level consistency, sqlfluff integrates with pre-commit hooks.

Supported SQL statements

  • SELECT (including CTEs with WITH)
  • INSERT INTO … VALUES
  • UPDATE … SET
  • DELETE FROM
  • CREATE TABLE / ALTER TABLE / DROP TABLE
  • UNION and UNION ALL
  • All JOIN variants: INNER, LEFT, RIGHT, FULL OUTER, CROSS
  • Subqueries in FROM and WHERE clauses

Related tools and guides

  • JSON Formatter — format and validate JSON in your browser
  • Diff Checker — compare two SQL versions to see what changed
  • Regex Tester — test regex patterns used in SQL LIKE or application code

Frequently Asked Questions

Do popular SQL formatters send queries to a server?
Yes — tools like sqlformat.org and many others POST your query to a backend for processing. Verify by opening DevTools → Network tab and pasting your query: if you see a POST or XHR request, the query was transmitted.
What does a browser-based SQL formatter do differently?
A JavaScript formatter tokenises your query locally, uppercases keywords from a hard-coded list, and inserts newlines before each major clause. No round-trip to a server is needed — the transformation takes under a millisecond for typical queries.
When does SQL privacy matter?
SQL privacy matters when queries contain embedded credentials in comments, table or column names that reveal internal schema, WHERE clause values with PII (emails, user IDs), or production data from live sessions. Sending these to a third-party formatter is an unnecessary risk.
Can I format SQL from the command line?
Yes — sqlfluff is an open-source SQL linter and formatter that runs entirely locally. Install with pip install sqlfluff, then run sqlfluff fix --dialect postgres my_query.sql. It supports PostgreSQL, MySQL, BigQuery, Snowflake, and more.
More free toolsSee all 109
Merge PDFsCompress ImageJSON FormatterPassword GeneratorVAT CalculatorQR Code Generator