Convert kebab-case to camelCase
Turning CSS property names, data attributes, or URL slugs into JavaScript identifiers means converting kebab-case to camelCase — the same mapping the DOM applies when data-user-id becomes dataset.userId. This converter splits on hyphens and capitalizes every word after the first.
background-color margin-top user-profile-card http-request
backgroundColor marginTop userProfileCard httpRequest
Try it with your own data
How to convert kebab-case to camelCase
- Split the identifier on each hyphen (background-color → background, color).
- Lowercase the first word and capitalize the first letter of every following word.
- Join the words back together with no separator.
Frequently asked questions
Where does this conversion happen automatically?
The browser does it for you in two places: CSS properties in JavaScript (background-color → el.style.backgroundColor) and data attributes (data-user-id → el.dataset.userId).
Does the converter handle mixed input?
Yes — the splitter understands hyphens, underscores, spaces, and existing capital-letter boundaries, so you can paste a mixed list and every line converts correctly.
How does the converter know where words start and end?
It splits on separators (underscores, hyphens, spaces) and on lowercase-to-uppercase boundaries, keeping acronym runs together — so HTTPServerError splits into HTTP, Server, Error regardless of the input convention.
Can I convert many identifiers at once?
Yes — put one identifier or phrase per line and every output format converts the whole list, ready to copy as a block.