devkult_
tools26converters34
home/convert/kebab-to-camel

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.

Example · kebab-casecamelCase
kebab-case input
background-color
margin-top
user-profile-card
http-request
camelCase output
backgroundColor
marginTop
userProfileCard
httpRequest

Try it with your own data

Loading tool…

How to convert kebab-case to camelCase

  1. Split the identifier on each hyphen (background-color → background, color).
  2. Lowercase the first word and capitalize the first letter of every following word.
  3. 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.

Related converters