← بازگشت به ویژگی‌ها
Free

SQL Formatter

SQL Formatter transforms minified or messy SQL into readable, indented queries. Keywords go on new lines (SELECT, FROM, WHERE, JOIN, ON, AND, OR), SELECT lists split one column per line, and multi-word keywords (GROUP BY, INNER JOIN, IS NOT NULL) are recognized. Optional UPPERCASE keyword normalization and syntax highlighting for keywords, functions, strings, and numbers.

Reading SQL copied from code or logs is often painful — ORMs produce single-line queries, log formatters strip newlines, and hand-written SQL from different authors uses inconsistent indentation. SQL Formatter gives you a clean, consistent view of any query in one click. The formatter tokenizes the SQL (handling strings, comments, numbers, identifiers, operators, and punctuation), recognizes ~80 SQL keywords including multi-word ones like GROUP BY, LEFT OUTER JOIN, IS NOT NULL, and ORDER BY. Top-level keywords (SELECT, FROM, WHERE, HAVING, etc.) each go on their own line. SELECT lists get one column per line, making wide column lists readable. JOIN clauses indent on a new line with their ON condition. Optional UPPERCASE normalization converts mixed-case keywords to uppercase for consistency. Syntax highlighting colors keywords purple, functions blue, strings green, numbers orange, and comments italic gray. Comments (-- line and /* block */) are preserved. A Minify option compacts a query back to a single line for one-liner use (e.g., as a string in code).

پیش‌نمایش زنده
example.com
SQL Formatter ✓ Formatted · 13 lines
Indent: 2 ✓ UPPERCASE keywords ✓ Syntax highlight
Input SQL (minified)
select u.id, u.name, count(o.id) as orders from users u left join orders o on o.user_id = u.id where u.active = true group by u.id, u.name order by orders desc limit 10
Formatted Output
SELECT u.id, u.name, COUNT(o.id) AS orders FROM users u LEFT JOIN orders o ON o.user_id = u.id WHERE u.active = true GROUP BY u.id, u.name ORDER BY orders DESC LIMIT 10;
ویژگی‌های کلیدی

Smart Keyword-Aware Formatting

Tokenizer recognizes ~80 SQL keywords (including multi-word GROUP BY, INNER JOIN, IS NOT NULL) for correct line breaking.

SELECT List Splitting

Each column in a SELECT list gets its own line — wide column lists become scannable.

UPPERCASE Normalization

Optional uppercase conversion for keywords gives your query consistent casing regardless of author.

Syntax Highlighting

Keywords, functions, strings, numbers, and comments are color-coded for easy structure scanning.

Comment-Safe

SQL comments (-- and /* */) are preserved in place during formatting — no surprise deletions.

Minify Mode

Collapses any formatted query back to a single line — useful when embedding SQL as a string literal in code.

موارد استفاده رایج

ORM Log Debugging

ORMs like Sequelize, Prisma, or TypeORM log single-line SQL. Paste into the formatter to understand the query structure.

Code Review

When reviewing a PR with embedded SQL strings, format them for readability before leaving comments.

Query Optimization

Format a slow query to see its JOIN structure clearly, making bottlenecks easier to spot during optimization.

Documentation

Produce cleanly formatted SQL for inclusion in README, internal wikis, or API documentation.

Teaching & Learning

New SQL developers can paste their queries and see proper formatting as a learning reference for idiomatic style.

نحوه استفاده
1

Open SQL Formatter

Click the SQL icon in the DevSuite Pro dock. A panel opens with options and an input area.

2

Paste Your Query

Paste any SQL — from ORM logs, a file, or a code editor. Works with SELECT, INSERT, UPDATE, DELETE, CREATE, and more.

3

Click Format

Press Format to get an indented, readable query with keywords on their own lines.

4

Tune Options

Adjust indent width, toggle UPPERCASE keywords, enable/disable syntax highlighting to match your style.

5

Copy & Use

Click Copy to grab the formatted or minified query. Paste into your IDE, ticket, or documentation.

آماده برای امتحان کردن هستید؟ SQL Formatter?

DevSuite Pro را به صورت رایگان نصب کنید و بیش از ۳۹ ابزار توسعه را برای مرورگر خود باز کنید.

افزودن به Chrome افزودن به Edge افزودن به FireFox