What's the name for hyphen-separated case?

There is PascalCase, camelCase and snake_case. The popular case types. But one case type that is always unknown is the case with a hypen. It is usually lower case and includes a "-". So how do we call it?

Segun Adebayo

Kevin Peters

3/17/2021

kebab-caseInformation
A banner that shows kebab-case with an arrow

The most common name how this case is called is kebab-case.

Overall, there are a lot of names of this case type and over time it evolved a lot and there is still no official name even though most people use kebab-case.

Why kebab case?

The most used name for this case is kebab-case. And it has a simple reason. The pattern looks like a kebab. A kebab is a dish, normally some form of meat on a skewer. If you put this kebab horizontally, then you have a structure like:

A kebab case representation of characters

You can always see a letter and then a part of the skewer. This is where the name kebab case is coming from.

Other Alternatives

Other than kebab-case, the hyphenated case also has a lot of different names that we will cover in this chapter. These are alternatives and can be used, but we recommend to stick to the name kebab-case.

hyphen-case

hyphen-case is probably the most natural name to choose for this type of casing. It is simple. A "-" is officially called hyphen. So that is where the name is coming from. This name is not often used though. Reasons? We do not know. It seems like the community likes to have a more thoughtful name for this case type.

spinal-case

Similar to the kebab, the spine of a human has the same structure as a kebab. You have kind of a skewer which is the core of your spine. These are the "-" in the case type. And then you have different segments of your spine. These are the letters or parts of words used that are then connected via the hyphens. A nice representation can be found below.

A spinal case representation of characters

caterpillar-case

This name for the hyphen case is based on the other cases we have already. Long before the case was created a lot of other case types like camelCase or snake_case existed. So it was the logical conclusion to also choose another animal that fits this case. People chose the caterpillar. It has different paths and is basically built up like a spine or kebab.

A spinal case representation of characters

dash-case

Dash case is really similar to hyphen-case. The "-" is also called dash. Even though it is not as widely used it is a valid form of this case type.

slug-case

A slug is coming from the SEO world. Basically it is a relative part within an URL. Like caseconverter.pro/blog/name-of-hyphen-separated-case where "name-of-hyphen-separated-case" is the slug. Basically it is the part that describes the page in detail. Wordpress, and especially yoast, drove the usage of this name.

Another framework that pushed that name is Django, a popular Python web framework. They are using the word "slugify" a lot when trying to convert a string to a valid kebab-case URL segment.

friendly-url-case

This name is coming as well from the SEO world. Google, the biggest search engine in this world, stated that it is easier for their search algorithms to parse URL paths with "-". Other combinations like PascalCase, camelCase or snake_case are more difficult to parse, or at least harder to associate. Nowadays the indexing algorithm by Google will probably understand all cases but the safest bet is to use kebab-case. But based on that the name friendly-url-case was also created. Because it made URLs friendly to get parsed by Google, Bing, DuckDuckGo and similar.

Non popular case names

There are also some other names that are probably used in the wild world. But it is a subset caused by languages, for example "lisp-case" or "css-case". This is most likely caused by language specifics that make certain identifiers in these languages case-sensitive. And this leads to have the developer using kebab-case for certain things. In CSS, for example, it is favored to use kebab-case for classes because otherwise class names could clash and cause bigger problems in styling a website.

Conclusion

As we can see there are a lot of names for this exact case. Overall, we recommend to use kebab-case though because it is the most widely used name for this case type nowadays.

More from caseconverter.pro

  • some text
    JavaScriptTutorialEngineering

    How to change JSON keys in JavaScript

    Changing the keys in objects in JavaScript objects is sometimes required. JavaScript mostly works with camelCase and transforming other case types is really helpful to make linters happy.

    Segun Adebayo

    Kevin Peters

    4/11/2021

  • some text
    kebab-caseInformation

    What's the name for hyphen-separated case?

    For the hyphen-separated case there are multiple names: kebab-case, hyphen-case, slug-case and many other options... But what is the right one to choose. This article will help you to make a decision.

    Segun Adebayo

    Kevin Peters

    3/17/2021

  • some text
    EngineeringTechnology

    Why we love our tech stack

    The reasons why we love our technology stack at caseconverter.pro are quite diverse. Read it here and gather insightful statistics about which technologies were used and why you should use them too.

    Segun Adebayo

    Kevin Peters

    1/19/2020

This site is using cookies to personalize content and adverts, to provide social media features and to analyse traffic.