BOXUNBAOTools
Simplify everyday tasks.Back to website
ToolboxSQL Formatter

SQL Formatter

Runs in your browser

Format MySQL queries with consistent indentation, line breaks, and keyword casing.

How to use

Steps

  1. Paste one or more MySQL statements, including the original quotes, backticks, and comments.
  2. Choose a 2- or 4-space indent and choose uppercase, lowercase, or original casing for keywords.
  3. Select Format to check line breaks and indentation. Copy result gives you the full SQL. Use Text Diff to review the changes.

Example

Select Uppercase and format the query below.SELECT, FROM and WHERE appears on separate lines, while the string 'MiXeD' keeps its original casing.

select id, name from articles where name = 'MiXeD' and status = 1;

Tips

  • Formatting uses the MySQL dialect and supports up to 100,000 characters at a time. If parsing fails, check the quotes or split the script into separate statements.
  • Use the result for formatting or review. Run queries and verify the data in your MySQL environment.