Skip to content
Tesserae

Keyboard shortcuts

Focus search
/
This help dialog
?
Run the current tool
Ctrl/⌘ +Enter
Copy the output (when an output is focused)
Ctrl/⌘ +C

Shortcuts are ignored while you are typing in an input, a textarea or a select.

Web & CSS

JS Object to CSS

Convert a React-style JS object (or a plain JSON object) back into CSS. camelCase keys become kebab-case, WebkitTransform becomes -webkit-transform, numbers become px where length units apply (opacity, z-index and friends stay unitless), and booleans are dropped. A bare object makes a declaration list; nested makes rules. Complements css-to-js.

On-device No network Offline-ready

🔒 100% Client-Side & Private — processed locally in your browser. Files never leave your device.

Try:

Options

Your result will appear here

Type or paste your input above, adjust the options, then press Run. Tip: press Ctrl+Enter to run, and ? for every shortcut.

How it works

What the converter emits

JS Object to CSS turns a React-style style object, or an equivalent JSON object, back into CSS. camelCase keys become kebab-case, a leading capital like WebkitTransform becomes a -webkit- prefix, quoted values are unquoted, and content values are re-quoted. A bare object becomes a declaration list and a nested object becomes rules.

When to leave CSS-in-JS behind

Reach for it when moving styles out of a component into a stylesheet, or when you have a JSON style blob from a design tool or an API and need readable CSS. It is the reverse of css-to-js, so it also helps check that a round trip lost nothing.

The px toggle and key casing

The pxForNumbers toggle decides what happens to bare numbers. On, a number on a length property such as width or font-size gains px, while unitless properties like opacity, z-index, line-height and font-weight stay bare and 0 is never given a unit. Off, every number is emitted as written.

Values the converter drops

Booleans, null, undefined and empty values are dropped, since CSS has no equivalent for React truthiness. Input is capped at 200,000 characters and must be a balanced object literal; a missing brace or a malformed entry is reported rather than guessed at, and if every entry was nested or dropped there is nothing to convert.

Where the object is parsed

The conversion runs in your browser only. Your style object is parsed and rendered on the device, never uploaded, and the tool makes no network requests.

Questions

Which properties get px?

Bare numbers on properties that accept lengths (width, margin, font-size…) become px. Numeric props like opacity, z-index, line-height, flex-grow and font-weight stay bare because CSS treats them as unitless.

How are booleans and null handled?

They are dropped — React uses truthiness to disable some properties (e.g. display: false), and CSS has no equivalent.

Can I convert a whole style tree?

Yes. A nested object becomes rules: { "@media (max-width: 600px)": { … } } or per-selector keys work the same way as css-to-js.

See category