Databases

SQL Formatter

Format SQL queries in a readable way directly in the browser. The tool does not execute SQL; it only rearranges keywords, indentation and line breaks for better readability.

Input

Options

Analysis

No query formatted yet.
Characters 0
Tokens 0
Table hints 0
Parentheses -

This tool checks only simple structural hints. It is not a full SQL parser and does not execute database queries.

Formatted output

Ready

Formatting rules

  • Keywords such as SELECT, FROM, WHERE, JOIN and ORDER BY are detected.
  • Strings in single quotes, double quotes and backticks are preserved.
  • Comments can be kept or removed from the output.
  • The formatter is intended for typical queries, views, reports and debug output.
  • For complex dialect-specific SQL, review the result before production use.