CSS

CSS Coin Border Generator

Details

How to use CSS Coin Border Generator

What the tool does, how to run it, and what to expect from the result.

How to create a CSS coin border

Set the face and dash colors, the coin size, the number of dashes, and the ring thickness. The preview draws the coin exactly as the copied CSS will: a colored circle with a masked conic-gradient ring around it.

The copied snippet is a class plus a ::before pseudo-element that carries the ring. It has no dependencies and no images, so it scales to any resolution without going blurry.

  • Pick the face color and the dash color.
  • Set the coin size (80px to 280px).
  • Set the dash count, keeping it under about 60 for a small coin so the dashes stay distinct.
  • Set the ring thickness (4px to 30px).
  • Press Copy result and paste the class and its ::before rule into your stylesheet, keeping the -webkit-mask line for Safari.
Tips

Getting a better result out of CSS Coin Border Generator

Specific settings and thresholds, not general advice.

  • The milled edge is a repeating-conic-gradient masked into a ring by a radial-gradient mask. That is the whole trick: hard color stops around a conic gradient give you the dashes, and the mask hides everything except the annulus.
  • Dash count and dash width are the same control. The conic gradient's step is 360 / count degrees, with the dash filling the first half of each step. So 40 dashes means each dash is 4.5 degrees wide with a 4.5-degree gap.
  • There is a legibility ceiling. At 90 dashes on a 200px coin, each dash is about 3px wide at the rim, and on a standard-density display it starts to alias into a grey band. Keep the dash count under about 60 unless the coin is large.
  • The ring is drawn on a ::before pseudo-element sized to the coin plus twice the ring thickness, so the ring sits outside the face rather than eating into it. If you change the size in the copied CSS, change the ::before dimensions to match.
  • The mask uses -webkit-mask alongside the standard mask property. Keep both when you paste: Safari still needs the prefixed form for mask-image in several contexts.
Limits

What CSS Coin Border Generator does not do

The honest boundary, so you do not lose time finding it yourself.

  • Two colors: one face, one dash. There is no metallic gradient, bevel, or highlight.
  • It is decorative only. It does not produce a coin image, an SVG, or an exportable asset.
  • The face is a flat circle. There is no relief, embossing, or engraved text.
  • No animation, so there is no spin or flip.
At a glance

Who CSS Coin Border Generator is for

A quick way to understand who this helps, what it solves, and where it connects next.

Best fit

Designers making decorative CSS borders.

Ideal for

Using the css coin border generator without installing anything or signing up.

FAQ

Common questions

Short answers for the questions people usually have before trying a utility like this.

How does the milled edge actually work?

A repeating-conic-gradient sweeps around the circle with hard stops, producing alternating wedges of dash color and transparency. That gradient is painted on an oversized pseudo-element and then masked with a radial-gradient that is transparent in the middle and opaque at the rim, so only the outer ring survives. The result is a dashed annulus, which reads as a milled coin edge.

Which browsers support this?

All current ones. conic-gradient has been supported everywhere since 2020, and mask-image is universal, though Safari still wants the -webkit-mask form in some cases, which is why the generated CSS includes both. There is no polyfill path for a browser too old for conic-gradient, so use a background image there.

Why do the dashes turn into a grey blur at high counts?

Because each dash gets narrower as the count rises. At 90 dashes on a 200px coin, the dashes are only a few pixels wide at the rim and the display cannot resolve the alternating pattern, so it averages into a solid band. Lower the dash count, or make the coin bigger.

Can I add text or a relief to the coin face?

Not from the tool: the face is a flat colored circle. You can put anything you like inside the element in your own markup, since the ring lives on a pseudo-element and does not interfere with children. Centre a character or an SVG in the face with flexbox.

How do I resize the coin after I have copied the CSS?

Change three numbers together: the width and height on the base class, and the ::before width and height, which are the coin size plus twice the ring thickness. Change only one and the ring will detach from the face. Regenerating at the size you want is less error-prone.

Why use CSS rather than an image?

It is a few hundred bytes, it scales cleanly to any size and any DPI, and both colors and the dash count are variables you can change at runtime. A PNG of the same coin is a network request, a fixed resolution, and a fixed color.

Recommendations

You Might Also Like

Nearby tools from the catalog that fit the same job or workflow.

Cleanor app

Do it all on your device

Cleanor puts these tools in one app: compress and convert images, video, and audio, work with PDFs, and scan text right on your device. Plus free up storage and clear inbox clutter with Email Cleaner. Start with a free trial.

  • iPhone
  • Android
  • Macsoon
  • Windowssoon