Skip to content
← Typography Tools

CSS Counter Style Generator

Create custom ordered-list markers with @counter-style: Roman numerals, alphabets, custom symbols, or repeating sequences.

Related Tools

Related Tool
CSS Tools
Related Tool
Responsive Type Calculator
Related Tool
Drop Cap Generator
Related Tool
Typography Scale

What @counter-style unlocks

The CSS @counter-style at-rule defines a custom way of producing the markers in an ordered list. The built-in list-style-type values cover the common cases: decimal, lower-roman, upper-roman, lower-alpha. @counter-style adds everything else: Roman with extended ranges, Greek alphabets, hand-picked emoji sequences, or any arbitrary symbol set. Once defined, the custom style is used by setting list-style-type: my-style-name on the ol element.

Behind the scenes @counter-style maps integers to glyph sequences using a system descriptor. The systems are: cyclic (repeat the symbols), numeric (positional like decimal), alphabetic (positional like A B C with carry to AA AB), symbolic (each symbol used in turn then doubled), additive (Roman-style sum of symbol values), fixed (exact mapping per integer), and extends (inherit and override a built-in).

When you actually need this

Documentation sites with deeply nested lists outgrow the four built-in alphabets fast. Beyond level 4, the spec leaves you with arbitrary characters. @counter-style lets you set up a clean nesting like 1, a, i, 1.a.i with the levels visually distinct.

Brand-conscious editorial sites use custom symbol sets to match their voice. A wine review site might number tasting notes with grape emojis. A trail guide might use mountain symbols. A legal document might need section-mark prefixes (§ 1, § 2). All these are one @counter-style declaration.

Common Use Cases

Technical documentation uses @counter-style to render appendix-style numbering: Appendix A, Appendix B, then sub-items A.1, A.2. Recipe sites use it to set ingredient lists apart from cooking steps with different marker styles. Style guides use it to enforce one numbering pattern across every authored page.

Accessibility-focused teams use @counter-style with caution because not all screen readers announce custom markers. The speak-as descriptor can ask screen readers to announce the number instead, but MDN lists it as unsupported in Safari, so test with the screen readers your audience uses.

Worked example: what each preset renders

On October 12, 2026 we rendered every preset in Chromium and read each marker back from the browser's accessibility tree, which holds the text the browser actually drew:

PresetList numberMarker drawn by Chromium
roman-upper (additive)1, 4, 9, 1994I, IV, IX, MCMXCIV
roman-lower1994mcmxciv
greek-alpha (alphabetic)1, 24, 25, 1994α, ω, αα, γλβ
circled (fixed)10, 11⑩, then 11 from the decimal fallback
emoji-stars (cyclic)1 to 6⭐ 🌟 ✨ ⭐ 🌟 ✨
binary (numeric)9, 19941001, 11111001010

Frequently Asked Questions

Which browsers support @counter-style?
Per MDN's compatibility data: Chrome and Edge 91 (May 2021), Firefox 33 (2014) and Safari 17 (September 2023), on desktop and mobile; Internet Explorer never did. Browsers without support ignore the rule and draw the list's normal markers, usually decimal, so the list stays readable.
What is the difference between cyclic and symbolic systems?
Cyclic repeats the symbol list. If you define three symbols and have a list of seven items, you get symbol1, symbol2, symbol3, symbol1, symbol2, symbol3, symbol1. Symbolic uses each symbol once, then doubles them: symbol1, symbol2, symbol3, symbol1symbol1, symbol2symbol2, symbol3symbol3. Cyclic is right for repeating bullets. Symbolic is right for footnote markers.
How does the additive system work?
Additive gives each symbol a value and builds the marker from the largest values down, using the additive-symbols descriptor (value–symbol pairs separated by commas). Roman numerals are the usual example: with 1000 M, 900 CM, 500 D, 400 CD, 100 C, 90 XC, 50 L, 40 XL, 10 X, 9 IX, 5 V, 4 IV, 1 I, the number 27 becomes XXVII and 1999 becomes MCMXCIX. Until October 12, 2026 this tool's Roman preset wrote them under symbols, which made the whole rule invalid; it now writes additive-symbols, and Chromium parses the generated rule as an additive counter style with all 13 pairs.
What is the range descriptor for?
range tells the browser which integer values the counter style covers. Outside that range it uses the fallback style (decimal by default). The built-in upper-roman covers 1 to 3999; for an alphabetic style covering A through ZZ with 26 letters, the range would be 1 702. Without a range, each system uses its natural limits.
Can I prefix and suffix the marker?
Yes. The prefix descriptor adds a string before the marker. suffix adds a string after. A common pattern is prefix: "Step " suffix: ". " to produce markers like Step 1., Step 2., Step 3.. Prefix and suffix accept any string including spaces and special characters, so you can compose elaborate markers without touching the symbols list.
How does this interact with screen readers?
Screen readers usually read the marker text, so an emoji marker may be announced by its emoji name and a symbolic marker as its characters. The speak-as descriptor lets you ask for the number to be spoken instead; MDN lists it as supported in Chrome, Edge and Firefox but not Safari. Test with the screen readers your audience uses, and keep the item text meaningful without the marker.
Will @counter-style work inside ::marker pseudo-elements?
Yes, through the list item. Set list-style-type: my-style-name on the list or its items and the browser draws each marker with your style. Setting list-style-type on ::marker itself does nothing: CSS Lists Level 3 lets the marker box use only a few properties, such as content, plus inherited text styles like color and font. To build marker text yourself, use ::marker { content: counter(list-item, my-style-name) \". \"; }.
Why does my counter style fall back to decimal sometimes?
Usually one of three things. The number is outside the range. The system is fixed and the list is longer than the symbols. Or the whole rule is invalid, for example an additive system written with symbols instead of additive-symbols, or a cyclic system with no symbols; invalid rules are ignored and the list shows plain decimal. Alphabetic and numeric systems never run out of symbols.