JSON Formatter
JSON Formatter for developers — instant, offline-style and privacy-safe.
Beautify a one-line SQL query — major clauses on their own lines, keywords capitalised, columns split out — right in your browser. A quick keyword tidier, not a SQL parser.
Your browser is preparing the tool. It runs 100% locally.
Paste a cramped or one-line SQL statement and the tool lays it out: each major clause (SELECT, FROM, WHERE, JOIN, ORDER BY and so on) starts a new line, those keywords are capitalised, and each comma-separated column goes on its own indented line. It is a lightweight keyword tidier — it does not parse the SQL — so it is great for readability but has no awareness of dialects, subqueries or strings. It runs in your browser; nothing is uploaded.
This tool takes a SQL query that has been written or generated on a single line and reformats it into the conventional, readable shape: clauses stacked vertically, keywords in capitals, and a column list broken out one per line.
It is the quick way to make a long query legible — to review a statement copied from a log, an ORM, or a query builder without pasting it into a database client.
The tool first collapses all runs of whitespace to single spaces. It then looks for a fixed list of SQL keywords — SELECT, FROM, WHERE, the JOIN family, GROUP BY, ORDER BY, HAVING, LIMIT and the main write statements — and starts a new line before each one, capitalising it as it goes. Finally, it puts each comma on its own line and indents the item that follows.
This is keyword matching, not parsing. The tool does not understand the query's structure, tables or expressions — it only recognises those specific words and the comma. That makes it fast and dependency-free, and it reads simple queries well, while complex ones need a proper formatter.
1 · collapse all whitespace to single spaces
2 · start a new line before each listed keyword, capitalised (SELECT, FROM, WHERE, JOIN family, GROUP BY, ORDER BY, HAVING, LIMIT, …)
3 · put each comma on its own line, indented two spacesBefore: select id,name,email from users where active=1 order by name
After:
SELECT id, name, email
FROM users
WHERE active=1
ORDER BY nameOnly the keywords in the list are capitalised and broken onto new lines; other text is left as you wrote it. Every comma is split, including commas inside a function call or a VALUES list.
Your query never leaves your device. It is reformatted in your browser with no network request, so nothing is uploaded.
Because the work is local, you can safely tidy queries that mention real table names or internal schema without them being stored or sent anywhere.
Nothing persists between sessions — close the tab and the input and output are gone.
It reads simple queries cleanly, but it is a keyword tidier, not a parser. It does not understand the query, so it cannot validate it, align subqueries, or know which dialect you are using — it only reacts to a fixed set of words and the comma.
The keyword list is short. Common words such as UNION, AS, LIKE, BETWEEN, IN, and CASE or WHEN are not in it, so they are neither capitalised nor broken onto a new line. Complex queries keep parts of their original layout.
Every comma is split onto a new line, including commas inside a function call, a VALUES list or a CAST. That can over-split a query, putting function arguments on separate lines where you would rather keep them together.
It matches keywords as whole words wherever they appear, so a keyword used inside a string literal — for example the word order within quotes — can be wrongly capitalised and broken. A parser would know it was inside a string and leave it alone.
Lay out a one-line statement from a log or an ORM.
Stack the clauses to scan a statement quickly.
Format a query for a pull request or a message.
Present SQL clearly in documentation.
For complex, dialect-aware formatting that handles subqueries, strings and CTEs, use a parser-based tool (such as sqlformat or a SQL plugin in your editor or database client). This tool is for a fast in-browser tidy of a simple query.
Breaks lines before a fixed list of SQL keywords and after commas, and uppercases those keywords; honest that it is a pattern tidier, not a parser, so it has no dialect or subquery awareness.
JSON Formatter for developers — instant, offline-style and privacy-safe.
JSON Validator for developers — instant, offline-style and privacy-safe.
Base64 Encoder for developers — instant, offline-style and privacy-safe.
Fast, free Hash Generator that runs entirely client-side in your browser.
Fast, free UUID Generator that runs entirely client-side in your browser.
Fast, free CSS Minifier that runs entirely client-side in your browser.
It is free, private and runs entirely in your browser — no sign-up, no uploads, no limits.