UtilitySansar
Developer

SQL Formatter / Beautifier

Turn dense SQL into a readable, consistently indented layout with one clause per line, uppercased keywords, and aligned JOINs and subqueries.

도구 요약

이 도구는 구조화된 입력을 받아 서버 업로드 없이 브라우저에서 결정적인 출력을 반환합니다.

도구 이름
SQL Formatter / Beautifier
입력 의도
변환·검증·분석할 원본 콘텐츠를 제공하세요.
출력 의도
복사, 재사용 또는 디버깅에 적합한 정규화된 출력을 받습니다.
예시 입력
select id,name,email from users where created_at > now()-interval '7 days' order by id desc
예시 출력
SELECT id, name, email FROM users WHERE created_at > now() - INTERVAL '7 days' ORDER BY id DESC
Keywords are uppercased; clauses go on their own line. Multiple statements separated by ; are formatted independently.

도구 소개

Turn dense SQL into a readable, consistently indented layout with one clause per line, uppercased keywords, and aligned JOINs and subqueries.

도구 개요

A well-formatted SQL query reads like a paragraph, not a wall of words. This tool tokenizes your statement, places each major clause (SELECT, FROM, WHERE, GROUP BY, ORDER BY, JOIN) on its own line, indents subqueries and CTE bodies, and uppercases standard keywords. It keeps quoted identifiers, string literals, and inline comments untouched. Works with PostgreSQL, MySQL, SQLite, SQL Server, and ANSI SQL.

사용 사례

  • Clean up SQL pasted from logs or ORMs before reviewing it in a PR.
  • Standardize team query style without installing a CLI formatter.
  • Make a complex CTE chain readable for documentation or onboarding.

입력/출력 예시

입력 의도
select id,name,email from users where created_at > now()-interval '7 days' order by id desc
출력 의도
SELECT
  id,
  name,
  email
FROM users
WHERE created_at > now() - INTERVAL '7 days'
ORDER BY id DESC

자주 묻는 질문

Will it modify my data or run the query?+
No. The tool only reformats the text. Nothing is executed against any database.
Does it support PostgreSQL-specific syntax?+
Yes. ::casts, $$ dollar-quoted strings, RETURNING, ON CONFLICT, and JSONB operators are recognized and preserved.
Can it format multiple statements at once?+
Yes. Statements separated by semicolons are formatted independently and joined with a blank line between them.

다른 도구 보기

아래의 Developer 카테고리에서 관련 유틸리티를 찾아보세요.

전체 Developer 보기

관련 도구

유용할 수 있는 엄선된 유틸리티