CSS Class Name Generator

BEM and utility-style CSS class names

Ad placeholder (leaderboard)

What this tool does

The CSS Class Name Generator produces consistent, valid class names for common UI components in three popular styles: BEM, utility-first, and semantic. Pick a component and a style, and it returns several ready-to-paste class names so your CSS architecture stays coherent instead of ad hoc.

How it works

Each style has its own assembly rule. BEM combines a block (the component), an optional element joined by __, and an optional modifier joined by -- — for example modal__header--sticky. Utility-first draws short single-purpose tokens like flex, p-4, text-center, mimicking atomic CSS. Semantic pairs a purpose word with the component, such as primary-button or page-card. Every output uses only valid class-selector characters and begins with a letter.

All names are generated locally in your browser.

Tips and notes

  • BEM elements use __ and modifiers use -- — the canonical syntax.
  • Utility names are intentionally terse and composable; combine several on one element.
  • Semantic names survive restyles because they describe intent, not looks.
  • Re-roll to explore variants and pick the one that reads best in your markup.
Ad placeholder (rectangle)