Paste your CSS
Drop in loose declarations like color: red; or entire rulesets with selectors, comments and media queries. You can also drag a .css file straight onto the editor.
Runs 100% in your browser — your CSS is never uploaded
Paste CSS — loose declarations or a whole stylesheet — and get a React style object, a React Native StyleSheet, typed TypeScript, JSON or an inline JSX attribute. Converted as you type.
Three steps, no sign-up, and the CSS never leaves your machine.
Drop in loose declarations like color: red; or entire rulesets with selectors, comments and media queries. You can also drag a .css file straight onto the editor.
Switch between a React style object, a React Native StyleSheet.create call, typed TypeScript, plain JSON, or a ready-to-paste inline style attribute for JSX.
Read any warnings about properties that will not survive the jump, then copy the object to your clipboard or download it as a file for your project.
A style object is JavaScript, not CSS, so a handful of things have to be rewritten rather than copied. These are the conversions the tool applies for you.
| CSS | React (web) | React Native |
|---|---|---|
background-color: red |
backgroundColor: 'red' |
backgroundColor: 'red' |
font-size: 16px |
fontSize: '16px' or 16 |
fontSize: 16 — units are dropped |
padding: 8px 16px |
padding: '8px 16px' |
Expanded to paddingTop, paddingRight, paddingBottom, paddingLeft |
border: 1px solid #ccc |
border: '1px solid #ccc' |
Expanded to borderWidth, borderStyle, borderColor |
box-shadow: 0 2px 6px #0003 |
boxShadow: '0 2px 6px #0003' |
shadowColor, shadowOffset, shadowRadius, shadowOpacity, elevation |
transform: rotate(45deg) |
transform: 'rotate(45deg)' |
transform: [{ rotate: '45deg' }] |
-webkit-line-clamp: 2 |
WebkitLineClamp: '2' |
Not supported — reported as a warning |
--brand: #0800ff |
'--brand': '#0800ff' |
Not supported — reported as a warning |
color: red !important |
color: 'red' — flag dropped |
color: 'red' — flag dropped |
Inline style objects are perfect for values that change at runtime and awkward for everything a stylesheet does well. Use them deliberately.
StyleSheet objects are the only styling model.:hover, :focus and ::before — inline styles cannot express them at all.@media and @supports — you need a stylesheet, a CSS-in-JS library, or a resize hook.Everything people usually ask about converting CSS into React style objects.
No. The entire conversion runs in your browser with JavaScript. Nothing is sent anywhere, so proprietary stylesheets stay private — you can load the page once, go offline, and it still works.
A React style object is a plain JavaScript object, and a hyphen is not valid in an unquoted JavaScript key — background-color would parse as a subtraction. React therefore expects backgroundColor. CSS custom properties such as --brand-color are the one exception: they keep their exact name and are emitted as quoted keys.
Yes. Every ruleset becomes its own named object, with the key derived from the selector — .btn-primary becomes btnPrimary, #site-header becomes siteHeader. Comments, at-rules and rules nested inside @media are parsed properly instead of corrupting the output. Tick Merge all rules into one object if you would rather flatten everything into a single style.
React Native uses unitless numbers, so 16px becomes 16. Shorthands are expanded because React Native rejects multi-value margin or padding; box-shadow becomes shadowColor, shadowOffset, shadowRadius and shadowOpacity plus an Android elevation; and transform becomes an array of single-key objects. Anything React Native does not support is listed in the warnings panel rather than silently emitted.
It is stripped, and the tool tells you where. Inline styles already beat stylesheet rules on specificity, and the browser ignores !important inside a style object, so carrying it across would do nothing.
They are kept as separate named objects so no work is lost, but React inline styles cannot apply :hover, ::before or @media by themselves. Apply those objects conditionally from state, or hand them to a CSS-in-JS library or a plain stylesheet.
On the web either works — React appends px automatically to a unitless number on properties that take a length, and leaves genuinely unitless ones such as lineHeight, zIndex, opacity and flexGrow alone. Strings are the safer default because they preserve your units exactly, so the tool keeps them unless you tick Unitless values as numbers. React Native requires real numbers, so that output always converts them.
Yes. A prefixed property becomes a capitalised camelCase key, which is what React expects: -webkit-box-orient becomes WebkitBoxOrient and -moz-appearance becomes MozAppearance. The -ms- prefix is the odd one out — React wants a lowercase ms, so -ms-flex-align becomes msFlexAlign.
Not with this tool — it runs one way. Going back is mostly mechanical though: un-camelCase each key into a hyphenated property and add px to bare numbers on length properties.
Yes. Completely free, no sign-up, and no limit on how much CSS you convert.
Other browser-based utilities from SeeB4Coding.