Format or minify CSS with indentation, media query support, CSS variable preservation, and comment options.
CSS Formatter is a free online tool that adds line breaks and indentation to CSS code, making it easy to read and edit. It supports media queries, @keyframes, CSS variables, and optional comment preservation. The tool runs in your browser and does not send data to the server.
Choose a related tool for the next step.
Data passed between tools is kept only in the current browser session.
CSS Formatter adds line breaks and indentation to CSS code, making styles easier to read, review, and edit. The tool is useful for minified CSS, DevTools output, CMS stylesheets, email template styles, and style blocks from web pages.
You can choose 2 or 4 space indentation, optionally preserve or strip comments, enable alphabetical property sorting (disabled by default to avoid breaking cascade and fallback order), and handle CSS custom properties. The tool formats standard CSS and warns about SCSS/LESS-like syntax without compiling preprocessor code.
All processing is done locally in the browser. Your data is not sent to the server.