SQL 포맷터
복잡한 SQL 쿼리를 읽기 쉬운 들여쓰기와 키워드 정렬로 서식 지정합니다.
브라우저에서 실행되며 데이터가 기기 외부로 전송되지 않습니다완전 무료, 회원가입 불필요
Formatted SQL
The formatted SQL will appear here.
작동 방식
The query is tokenized by the sql-formatter library (a real, dialect-aware SQL formatter) and re-emitted with a standard layout: each column on its own line, clauses (FROM, WHERE, GROUP BY, ORDER BY) at the top level, join conditions aligned, and logical operators split onto separate lines.
주요 기능
- 12 SQL dialects, from MySQL to BigQuery
- Keyword case: preserve, UPPERCASE or lowercase
- 2 or 4 space indentation
- Copy, download and upload actions
- 100% client-side, nothing leaves your browser
사용 방법
- Paste your SQL query.
- Pick the dialect and your formatting preferences.
- Press Format SQL, then copy the result or download it as a .sql file.
예시
Input: SELECT id,name FROM users WHERE active=true
Output: SELECT
id,
name
FROM
users
WHERE
active = true자주 묻는 질문
- Which SQL dialects are supported?
- Twelve: Standard SQL, MySQL, MariaDB, PostgreSQL, SQLite, T-SQL (SQL Server), PL/SQL (Oracle), BigQuery, Snowflake, DuckDB, Amazon Redshift and Apache Spark. The dialect controls tokenizer rules (things like string quoting, comments and dialect-specific keywords), so picking the right one produces the cleanest output.
- Does the formatter validate my SQL?
- No. It is a formatter, not a validator. It formats what it can tokenize and passes the rest through, so syntactically broken SQL may still produce output. Always test your SQL against a real database; use this tool to make queries readable, not to check they are correct.
- What does the keyword case option do?
- It controls the capitalization of SQL keywords like SELECT, FROM and WHERE: preserve leaves them exactly as you wrote them, while UPPERCASE and lowercase rewrite them consistently. Identifiers (table and column names) are never changed.
- Will formatting change what my query does?
- No. Formatting only adds whitespace and line breaks; the tokens of your query are left untouched. The formatted query is semantically identical to the input.
- Is my SQL sent to a server?
- No. Formatting happens entirely in your browser with JavaScript. Nothing you type is transmitted anywhere; you can verify this in your browser's network inspector.