AZ Tools

CSS to JS Style Object Converter

Developer

Paste CSS declarations (property: value;) and get a JavaScript style object with camelCased keys, ready for React's `style` prop or any JS styling. Vendor prefixes and CSS custom properties are handled. Everything runs locally in your browser — nothing is uploaded.

JS style object

How to use

  1. Paste your CSS declarations into the input box.
  2. Each property is camelCased and each value quoted as a string.
  3. Copy the generated style object from the output box.

Frequently asked questions

How are property names converted?
Hyphenated properties become camelCase (font-size becomes fontSize). Vendor prefixes follow React's rules: -webkit- becomes Webkit, while -ms- stays lowercase ms.
What about CSS custom properties?
Variables like --main-color keep their name and become a quoted key, since React applies them verbatim.
Are values converted to numbers?
No. All values are emitted as quoted strings, which is always valid. Drop the quotes manually for unitless numeric values if you prefer.
Is my CSS sent anywhere?
No. Conversion happens entirely in your browser; nothing is uploaded.

Related tools