Simple online tools for developers, networking, text and conversions.

Developer Tools

CSS Prettify

Format messy CSS into clean readable rules with indentation and line breaks.

Tool

Use this CSS Prettify tool to turn compact or messy CSS into a cleaner readable layout. It is useful for debugging copied styles, inspecting generated rules, cleaning one-line CSS, and making selectors and declarations easier to scan before editing or sharing.

About this tool

Use this CSS Prettify tool to turn compact or messy CSS into a cleaner readable layout. It is useful for debugging copied styles, inspecting generated rules, cleaning one-line CSS, and making selectors and declarations easier to scan before editing or sharing.

Use css prettify when you need a fast browser-based result without extra setup. It works well for quick checks, one-off tasks, and routine formatting or calculation work.

Learn more

Why use this tool

How to use

  1. Paste CSS into the input box
  2. Click Run Tool to format it
  3. Review the indented readable output
  4. Scan selectors and properties more easily
  5. Copy the formatted CSS for editing or reuse

Examples

Example

Input

body{margin:0;padding:0;}h1{color:red;}

Output

body {
  margin: 0;
  padding: 0;
}

h1 {
  color: red;
}

Useful when CSS is compressed into one line.

Example

Input

@media screen and (max-width:600px){.card{padding:12px;}}

Output

@media screen and (max-width:600px) {
  .card {
    padding: 12px;
  }
}

Makes media-query styles easier to inspect.

Common errors

Pasting broken CSS with missing braces

Fix: Check whether each rule block opens and closes correctly.

Expecting full parser-level correction

Fix: Use it for readability first, then review broken syntax manually.

Using CSS Prettify for SCSS or LESS-specific syntax

Fix: Review non-standard syntax carefully after formatting.

FAQ

What does CSS Prettify do?

It adds indentation and line breaks to make CSS easier to read.

Is CSS Prettify the same as a CSS beautifier?

Yes. Both names usually mean formatting CSS into a cleaner readable layout.

Does CSS Prettify validate CSS?

No. It focuses on readability rather than full validation.

What is the difference between CSS Prettify and CSS Minify?

CSS Prettify makes CSS readable. CSS Minify removes whitespace to make CSS compact.

Can I use it for copied browser inspector CSS?

Yes. That is one of the most useful cases for this tool.

Use cases

Related tools