Convert a JSON style object into CSS
Describe selectors and declarations in JSON, then generate readable CSS locally in your browser. This tool is intended for style-shaped objects. Review the generated stylesheet before using it in a website.

Use selectors as object keys
Each selector can contain an object of CSS properties. For example, a .card key can hold color and padding declarations. Camel-case property names such as backgroundColor are converted to hyphenated CSS names. Provide units explicitly where CSS requires them, such as 16px for padding. Numeric values are not automatically assigned pixel units.
Plain top-level declarations are grouped into :root. Nested objects create selectors, and an ampersand refers to the parent selector. The example below turns &:hover into .card:hover. Check that the generated rules match your intended elements before copying them into a stylesheet.
Check input before conversion
Use valid JSON with double-quoted property names and strings. Trailing commas and JavaScript comments are not valid JSON. A JSON array or an API response with unrelated business fields does not describe the same structure as a stylesheet. Arrays and null declaration values are skipped by this converter, so inspect the result for omitted content.
A syntactically valid result can still contain an invalid CSS property or value. This tool transforms the structure; you should verify the declarations in the page that will use them. Keep the original JSON to make later corrections, and use JSON Formatter when you first need to inspect or correct the input.
Keep working data on your device
Conversion uses local JavaScript in the browser. The JSON does not need to be sent to a conversion server. Use sample data to learn the expected structure, and review your organization's handling requirements before pasting confidential material. The website privacy policy explains network requests associated with the site itself.
JSON input and generated CSS
JSON input
{".card":{"padding":"16px","backgroundColor":"white","&:hover":{"color":"blue"}}}CSS output
.card {
padding: 16px;
background-color: white;
}
.card:hover {
color: blue;
}Common questions
Can any JSON become a complete webpage?
The converter expects selectors and declaration values. It generates stylesheet text, which you must connect to matching HTML. It does not infer a page design from arbitrary API data.
Why did a value disappear?
Array and null values are skipped as declarations. Nested objects are interpreted as selector blocks. Inspect the original structure and use simple CSS-compatible strings or numbers for declaration values.
Related tools
Read the privacy policy for website resource and analytics information.