BEM Class Name Generator
NewBuild BEM (Block__Element--Modifier) class names from a block, element, and modifier, with kebab-case normalization and an example HTML snippet.
—
Build a full block: add elements/modifiers below
—
—
BEM (Block, Element, Modifier) is a CSS naming convention: block is a standalone component, block__element is a part of that block, and block--modifier / block__element--modifier represents a different state or variation. All names are normalized to lowercase kebab-case.
Frequently Asked Questions
What does BEM actually stand for and solve?
BEM stands for Block, Element, Modifier — a CSS naming convention where a Block is a standalone reusable component (like `.card`), an Element is a part of that block written as `block__element` (like `.card__title`), and a Modifier represents a variant or state written as `block--modifier` or `block__element--modifier` (like `.card--highlighted`) — it solves the problem of CSS specificity conflicts and unclear ownership by making every class name self-documenting.
Why does the tool force everything to lowercase kebab-case?
BEM convention (as popularized by Yandex, who created it) uses lowercase, hyphen-separated words within each part of the name — normalizing input automatically means you can type a block name like "User Card" and still get a spec-compliant `user-card` output without manually reformatting it.
What's the difference between the single class name builder at the top and the list builder below it?
The top section builds one class name at a time from three separate fields; the list builder lets you define an entire block's worth of elements and modifiers at once (one per line, like "element: title, modifier: highlighted") and see every resulting class name together, which is faster when scaffolding a whole component.
Can an element and a modifier be combined in one class name?
Yes — if you fill in both an element and a modifier, the tool produces the full `block__element--modifier` form, matching BEM's convention for a variant of a specific sub-part of a block (like `.card__button--disabled`).
Does the generated HTML snippet include the block's modifier classes too?
The example HTML focuses on elements (parts nested inside the block), since that's the more common structural use case — modifiers are typically added as an additional class alongside the base block or element class in real markup, which you can combine manually using the class names shown above.