웹 개발
CSS Minify / Beautify
프로덕션용으로 CSS를 압축하거나 압축된 CSS를 읽기 쉬운 형식으로 포맷합니다.
미리보기에는 너무 큼
미리보기에는 너무 큼
Minifying CSS strips whitespace, comments, and line breaks that only exist for human readability and have no effect on how a browser applies styles. The result is a smaller file and a faster page load.
How to use it
- Minify: paste CSS and the tool strips unnecessary whitespace, comments, and line breaks while keeping behavior identical.
- Beautify: paste minified CSS with no indentation to get a readable version back, with indentation and line breaks.
- Handy for quickly reading CSS from a third-party site that only ships a minified version.
Common uses
- Minifying CSS for production when there's no build tool (Vite, Webpack) set up, or for a quick one-off minification.
- Beautifying minified CSS from a third-party library to read or debug it.
- Estimating how much a CSS file will shrink before setting up an automated build.
Things to keep in mind
Minification never changes styling behavior — it's a purely syntactic transformation; if a page looks different after minifying, that's a bug in the tool, not an intentional change.
Without a source map, debugging minified CSS in production is harder — the line numbers shown in the browser console won't match the original file.
자주 묻는 질문
압축은 실제로 제 CSS에서 무엇을 제거하나요?
Minify는 공백, 줄바꿈, 주석을 제거하고 일부 값을 축약하여 CSS의 동작을 바꾸지 않으면서 파일 크기를 줄입니다.
Beautify가 원래 형식을 완벽하게 복원할 수 있나요?
Beautify는 가독성을 위해 압축된 CSS를 들여쓰기와 줄바꿈으로 다시 포맷하지만, 압축 중에 이미 제거된 주석이나 원래 스타일 선택은 복원할 수 없습니다.
압축이 유효한 CSS에 안전한가요?
예 — 구문적으로 유효한 CSS의 경우, 압축은 불필요한 문자만 제거하고 선택자나 속성 값을 절대 변경하지 않으며, 모든 작업이 브라우저 내에서 로컬로 이루어집니다.
서버가 이미 Gzip으로 파일을 압축한다면 여전히 압축이 필요한가요?
예 — 압축과 Gzip/Brotli 압축은 서로 보완합니다. 압축은 압축 처리 전에 소스 파일 자체를 줄이고, Gzip/Brotli는 전송 중에 그 결과를 한 번 더 압축하므로, 둘을 함께 쓰면 어느 한 기술만 쓸 때보다 최종 크기가 더 작아집니다.
압축된 CSS의 소스 맵이란 무엇인가요?
소스 맵은 압축된 CSS의 각 줄을 원본 형식화된 코드에 다시 매핑하는 별도 파일로, 실제로 프로덕션에 배포되는 것이 압축된 버전이더라도 디버깅 시 브라우저 개발자 도구가 올바른 줄 번호와 파일 이름을 표시할 수 있게 해줍니다.