CSS Portal

CSS stroke-miterlimit Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The stroke-miterlimit property controls how sharp corners (miter joins) are rendered on stroked paths by limiting how long the pointed extension at a join can be relative to the stroke thickness. When two line segments meet at an angle, a miter join produces a pointed corner that extends beyond the outer edge of the stroke; the miter limit imposes a threshold so that if that pointed extension becomes too long compared to the stroke thickness, the renderer substitutes a different join style (typically a bevel) instead. This prevents extremely long, thin spikes at acute angles that can look visually jarring or produce rendering artifacts.

Because the effect depends on the relationship between the corner geometry and the stroke’s thickness, stroke-miterlimit is most meaningful when used together with the join style specified by stroke-linejoin. If the join style is set to one that does not produce miters, the miter limit will have no visible effect. Likewise, changes to stroke-width or any transforms that scale the shape will change the apparent length of miters and therefore can change whether a given corner passes the miter threshold — so consider these properties together when designing stroked shapes that must remain consistent across sizes.

In practical use, adjusting stroke-miterlimit helps control sharpness and visual weight in icons, logos, and vector artwork where acute joins appear. Setting a tighter limit avoids spikes that may clip or alias poorly at small sizes, while a looser limit preserves the crisp pointed aesthetic for certain geometric styles. It’s also useful when animating shapes or morphing paths: as angles vary, the join type can switch between miter and bevel based on the limit, so anticipate and test transitions. For complex dashed or segmented strokes, interactions with properties like stroke-dasharray can alter where joins occur and thus influence how the miter limit affects the final rendering.

Definition

Initial value
4
Applies to
<circle>, <ellipse>, <line>, <path>, <polygon>, <polyline>, and <rect> elements in an svg
Inherited
yes
Computed value
as specified
Animatable
by computed value type
JavaScript syntax
object.style.strokeMiterlimit

Syntax

/* Value:  */
stroke-miterlimit: 4;


/* Global values */
stroke-miterlimit: inherit;
stroke-miterlimit: initial;
stroke-miterlimit: revert;
stroke-miterlimit: revert-layer;
stroke-miterlimit: unset;

Values

  • <number>A positive number (default is 4).

    • This number specifies the maximum ratio of the miter length to the stroke width.
    • If the miter length exceeds this ratio, the corner is rendered as a bevel join instead of a miter join.

Example

<div class='wrapper'>
<h2>stroke-miterlimit demo</h2>
<svg viewBox='0 0 260 130' xmlns='http://www.w3.org/2000/svg' class='demo'>
<g transform='translate(10,10)'>
<!-- sharp miter (high miterlimit) -->
<path d='M10 10 L70 10 L80 50' class='miter-large' />

<!-- bevelled corner (low miterlimit) -->
<path d='M10 70 L70 70 L80 110' class='miter-small' />

<!-- helper grid -->
<line x1='0' y1='0' x2='240' y2='120' class='reference' />
</g>
</svg>

<p class='legend'>
<span class='swatch miter-large'></span>
stroke-miterlimit: 10 - sharp corner kept
</p>

<p class='legend'>
<span class='swatch miter-small'></span>
stroke-miterlimit: 1 - bevel applied
</p>
</div>
/* Styles for the demo */
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;
  padding: 24px;
  background: #f7f9fc;
  color: #111827;
}

.wrapper {
  max-width: 520px;
}

.demo {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border: 1px solid #e6eef8;
  border-radius: 8px;
  padding: 12px;
}

/* common stroke settings */
.miter-large,
.miter-small {
  fill: none;
  stroke-width: 14;
  stroke-linejoin: miter;
}

.miter-large {
  stroke: #1e90ff;
  stroke-miterlimit: 10; /* large miterlimit preserves sharp corner */
}

.miter-small {
  stroke: #ff4d4f;
  stroke-miterlimit: 1; /* small miterlimit forces bevel */
}

.reference {
  stroke: rgba(0,0,0,0.08);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  fill: none;
}

.legend {
  margin: 8px 0 0 0;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch {
  display: inline-block;
  width: 18px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.06);
}

.swatch.miter-large { background: #1e90ff; }
.swatch.miter-small { background: #ff4d4f; }

Browser Support

The following information will show you the current browser support for the CSS stroke-miterlimit property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!