SQL 쿼리를 절 단위 줄바꿈과 일관된 키워드 대소문자로 형식화하거나 한 줄로 압축합니다.
SQL 포맷터 사용 방법
SQL 쿼리를 입력 상자에 붙여넣으세요.
형식화를 선택하여 보기 좋게 만들거나 압축을 선택하여 한 줄로 압축하세요.
키워드 대소문자를 선택하고 결과를 복사하세요.
This is a SQL formatter that takes a cramped, single-line or inconsistently styled query and beautifies it: each major clause on its own line, columns and conditions indented, and keyword casing made consistent. It can also do the reverse and minify a query to one line.
Readable SQL is easier to review, debug and maintain. When SELECT, FROM, WHERE, JOIN and GROUP BY each start a new line and the keywords share one casing, the shape of the query, what it returns and how it filters, becomes obvious at a glance.
Formatting is also useful right before committing a query so diffs stay small and reviewers see meaningful changes rather than reflowed whitespace.
You choose the keyword casing (for example uppercase keywords, which is the common convention) and whether to format or minify. The formatter is dialect-agnostic and handles the common ANSI SQL used by PostgreSQL, MySQL, SQLite and SQL Server.
Minify mode is handy for the opposite need: collapsing a formatted query back to a single line to embed in code or a config value.
The tool formats for readability rather than checking that your query is valid, so it will happily lay out a query with a typo in it. Treat clean output as a readability win, not a correctness check.
Everything runs in your browser, which matters because real queries often contain table names, column names and sometimes literal values that hint at your schema or data. None of that is uploaded.
자주 묻는 질문
SELECT, FROM, WHERE, JOIN 같은 주요 절을 각각 별도의 줄에 배치하고, 열과 조건을 들여쓰며, 가독성을 위해 키워드 대소문자를 정규화합니다.
아니요. 형식화는 브라우저에서 완전히 실행되므로 쿼리가 기기 밖으로 나가지 않습니다. 테이블이나 열 이름이 포함된 쿼리에도 안전합니다.
방언에 구애받지 않으며 PostgreSQL, MySQL, SQLite, SQL Server에서 사용되는 일반 ANSI SQL을 처리합니다. 구문을 검증하기보다 가독성을 위해 형식화합니다.
이 도구 임베드하기
이 도구를 직접 운영하는 웹사이트에 추가하세요. 아래 코드를 복사하면 자동으로 최신 상태로 유지됩니다.
<iframe src="https://monu.tools/embed/ko/sql-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>관련 도구
XML을 올바른 들여쓰기로 보기 좋게 만들거나 한 줄로 압축합니다. 주석, CDATA, 처리 명령이 보존됩니다.
CSS를 깔끔한 들여쓰기로 보기 좋게 만들거나 파일 크기를 줄이기 위해 압축합니다. 미디어 쿼리, calc(), 라이선스 주석을 처리합니다.
HTML을 블록 인식 들여쓰기로 보기 좋게 만들거나 압축합니다. pre, textarea, script, style의 내용은 보존됩니다.
일관된 들여쓰기와 간격으로 JavaScript를 보기 좋게 만들고 정렬합니다. 브라우저에서 완전히 실행됩니다.