Writing
Code
Other
Clean up
Shortcuts: Ctrl/Cmd + Enter copies the result, Ctrl/Cmd + Z undoes the last clean-up.
What kebab-case is
kebab-case writes every word in lowercase and joins the words with hyphens, like the words skewered on a kebab. My First Blog Post becomes my-first-blog-post. It is also called dash-case, hyphen-case or lisp-case.
How to use the converter
Type or paste a phrase into the box above. kebab-case is already selected, so the result appears underneath. Copy it and paste it where you need it. The other buttons switch to camelCase, snake_case or plain text if you need something else.
What it does to different input
| You type | kebab-case result |
|---|---|
My First Blog Post | my-first-blog-post |
user_first_name | user-first-name |
getHTTPResponse | get-http-response |
Order #42 shipped | order-42-shipped |
Café au lait | café-au-lait |
one | one |
Spaces, underscores, dots and punctuation all become word breaks, and names that are already joined, such as getHTTPResponse, are split where the capitals fall. If you paste several lines, each line becomes its own name.
Where kebab-case is used
- URLs and page slugs. Google's guidance on URL structure recommends hyphens to separate words in a URL, not underscores, so kebab-case is the usual choice for web addresses.
- CSS class names and custom properties such as
main-headerand--brand-colour. - File names, where spaces cause problems in links and command lines.
- HTML custom elements and some command-line options, such as
--dry-run.
Check these before you use the result
- Accented letters are kept.
Café au laitbecomescafé-au-lait. If you need a plain-letter URL, change é to e yourself. - Symbols are removed. A hash, ampersand or percent sign disappears, so
R&Dbecomesr-d. - Hyphens cannot be used in variable names in most programming languages, because the hyphen reads as a minus sign. Use camelCase or snake_case in code.
All converters: Uppercase to Lowercase · Lowercase to Uppercase · ALL CAPS Converter · ALL CAPS to Sentence Case · Capitalize Text · Title Case · Sentence Case · Toggle Case · Alternating Case · camelCase · PascalCase · snake_case · CONSTANT_CASE & dot.case
- What is kebab-case?
- Lowercase words joined with hyphens, such as my-first-blog-post. It is also called dash-case or hyphen-case.
- Is kebab-case good for URLs?
- Yes. Hyphens between words are the usual choice for web addresses and match the structure Google recommends.
- Can I use kebab-case for variable names?
- In most languages no, because the hyphen is read as a minus sign. It is fine for CSS classes, file names and URLs.
- Can it convert camelCase or snake_case?
- Yes. Underscores, spaces, dots and capital letters inside a name are all treated as word breaks.
- Does it work on several lines?
- Yes. Each line becomes its own kebab-case name.