How to convert kebab-case to camelCase
Convert kebab-case names to camelCase instantly. Type or paste a variable, function or column name and get the camelCase version as you type.
- Type or paste a kebab-case name, such as main-nav-item, into the box above.
- The camelCase version appears right away: main-nav-item becomes mainNavItem.
- Copy the result, or pick one of 17 naming styles for the From and To boxes.
How the conversion works
The converter first splits the name into words: at each capital letter, underscore, hyphen, dot and space. Then it writes the words in camelCase: the first word lowercase, every following word capitalized, no separators. Runs of capitals such as HTTP are kept together as one word, and digits stay attached to the word they follow.
kebab-case to camelCase examples
| kebab-case | camelCase |
|---|---|
main-nav-item | mainNavItem |
font-size | fontSize |
background-color | backgroundColor |
is-open | isOpen |
data-test-id | dataTestId |
aria-label | ariaLabel |
kebab-case and camelCase explained
kebab-case writes every word in lowercase and joins them with hyphens. It is used in URLs, CSS class names, HTML attributes and file names.
camelCase starts with a lowercase word and capitalizes every following word, with no separators. It is the standard for variables and functions in JavaScript, Java, C# and Swift.
Frequently asked questions
What happens to acronyms like HTTP or ID?
A run of capital letters is treated as one word, so parseHTTPResponse becomes parse_http_response in snake_case.
Does it change the meaning of my code?
No. It only rewrites the name. Remember to rename every place that uses the name, or your code will look for the old one.
Which style should I use?
Follow the convention of your language or project: camelCase in JavaScript and Java, snake_case in Python, Ruby and SQL, kebab-case in URLs and CSS.
Is this tool free?
Yes, it's free to use. No signup, no email required. Get results on this page.
How do I get my result?
Use the tool on this page. Your result appears here; no email delivery is required.