Format and beautify SQL queries with proper indentation, keyword uppercasing, and clause separation. Minify option included.
SQL Formatter is a developer tool that takes messy, single-line, or poorly indented SQL queries and reformats them into clean, readable code. It uppercases SQL keywords (SELECT, FROM, WHERE, JOIN), adds proper newlines between clauses, indents columns and subqueries, and highlights syntax in the output. It also includes a minify option to collapse formatted SQL back to a single line for use in code or scripts.
Enter or paste your SQL query into the input area. It can be messy, single-line, or already partially formatted.
Press Format SQL or Ctrl+Enter to beautify the query with proper indentation and keyword uppercasing.
Click Minify to collapse the SQL to a single compact line, useful for embedding in code.
The output includes syntax highlighting. Click Copy to get the plain-text formatted SQL.
Pretty-print and validate JSON with 2 / 4 space indentation.
Convert JSON arrays to CSV format. Auto-detects columns, proper escaping, download as .csv.
Convert CSV data to a JSON array of objects. Handles quoted fields and commas.
Beautify messy HTML with proper indentation or minify it for production.
Minify HTML by stripping comments, collapsing whitespace. Shows size savings.
Beautify CSS with proper indentation or minify it for production. Strips comments.