{"article":{"slug":"squircles","title":"Squircles","subtitle":null,"summary":"A Linebender wiki survey of squircle curves, from Piet Hein's superellipse to alternatives like the Fernández-Guasti squircle, comparing their parametrization, measurement and curvature for graphics use. Licensed CC BY 4.0.","content_type":"research","language":"en","canonical_url":"https://linebender.org/wiki/curves/squircle/","author":{"name":"The Linebender Authors","url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"Linebender","url":"https://linebender.org/","listing_slug":null,"listing":null},"topics":[{"name":"graphics","slug":"graphics","url":"https://listedarticles.com/topics/graphics"},{"name":"mathematics","slug":"mathematics","url":"https://listedarticles.com/topics/mathematics"},{"name":"design","slug":"design","url":"https://listedarticles.com/topics/design"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":1304,"reading_minutes":6,"published_at":"2026-11-16T16:53:22.140Z","added_at":"2026-11-16T16:53:22.140Z","updated_at":"2026-11-16T16:53:22.140Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":true},"profile_url":"https://listedarticles.com/articles/squircles","markdown_url":"https://listedarticles.com/articles/squircles.md","example":false,"citation":"The Linebender Authors, Linebender. \"Squircles.\" 16 Nov 2026. https://linebender.org/wiki/curves/squircle/ (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://linebender.org/wiki/curves/squircle/"},"body_markdown":"# Squircles\n\nA squircle is a shape intermediate between a square and a circle.\nThere is no single mathematical definition, rather there are a number of curves that fit this shape.\nAll general squircles are parametrized, and can vary between circle and square.\n\n## Superellipse\n\nThe best known squircle is the superellipse, popularized by Piet Hein.\nMartin Gardner wrote a detailed narrative of its origin in a [Scientific American column](https://archive.org/details/mathematicalcarn00gard/page/240/mode/2up) in 1977.\nThe text is replicated in <https://piethein.com/superellipse/> but that’s missing equations and figures.\n\nThe superellipse has the formula $|x|^n + |y|^n = 1$ (we’ll use a unit radius for convenience).\nWhen $n=2$ it is a circle, and it approaches a square asymptotically as $n \\rightarrow \\infty$.\n\n## Measurement\n\nThere is no standard measurement for squircles.\nFor superellipses, the exponent is the most common parameter.\nA good choice is the coordinates of the midpoint of the quadrant, assuming a unit radius; here $x$ and $y$ are equal.\nThe conversion formula is simple and intuitive: $x = 0.5^{1/n}$.\nThis measurement is called \"gauge\" in the interactive demo above, and is the primary parameter; with the exception of some unreachable regions of parameter space, it should be possible to compare different squircle variants with similar gauge.\n\n## Flat-sided squircles\n\nThere are two basic approaches to squircle creation.\nOne is a single analytic curve, where curvature reaches zero at the poles, but is otherwise nonzero.\nThe other is mixing straight line segments with corners.\nA significant advantage of the latter approach is that it can adapt to rectangles of arbitrary aspect ratio without distorting the corner shape.\n\n## The Apple squircle shape\n\nSquircles received renewed attention when Apple changed the icon shape from rounded rectangle to their own squircle in iOS 7 in 2013.\nThere were several blog posts to analyze and recreate the shape.\nAn early analysis suggested that it was a superellipse of exponent 5, but when people extracted the Béziers and looked more closely, that was found to be inaccurate.\nRather, it’s a flat-sided squircle.\n\nFor the raw Bézier path data of the Apple shape, the best source is the [PaintCode blog](https://www.paintcodeapp.com/blogpost/code-for-ios-7-rounded-rectangles).\nThis blog correctly points out some bugs in that logic, and also has some details on behavior for oval rather than square aspect ratios.\n\nThe Apple shape has a number of flaws, including one extraneous straight line segment, and a lack of symmetry.\nHowever, those flaws are minor, and really only reveal themselves under close analysis.\n\nThe Apple shape has no additional parameter, so its variation is controlled entirely by the length of the flat side.\nWith no flat side, it has a gauge fixed at 0.809.\n\nAn extremely detailed analysis of the Apple shape is in [The Art of Continuous Corners](https://tsuijunxi.github.io/en/2026/06/23/the-art-of-continuous-corners/).\n\n## The Figma squircle\n\nFigma published a blog post, [Desperately Seeking Squircles](https://www.figma.com/blog/desperately-seeking-squircles/), with an analysis of the Apple squircle and their own approximation.\nIt is influential because Figma is an important design tool, because their writeup was compelling, and because there are any number of open source implementations of it, mostly TypeScript/JavaScript.\n\n- [squircle-path-kit](https://msurguy.github.io/squircle-path-kit/) from msurguy\n- [figma-squircle](https://github.com/phamfoo/figma-squircle) from phamfoo\n  - [corner-smoothing](https://github.com/sanalabs/corner-smoothing) from sanalabs (uses figma-squircle)\n  - [squircle-js](https://github.com/bring-shrubbery/squircle-js) from bring-shrubbery (uses figma-squircle)\n- [figma\\_squircle](https://github.com/aloisdeniel/figma_squircle) from aloisdeniel (Dart/Flutter)\n- [Lisse](https://github.com/JaceThings/Lisse) from JaceThings\n\nThe Figma blog contains a plot of the Béziers comprising a cleaned up version of iOS 7 rounded rectangle, revealing three Bézier segments per quadrant.\nIt fixes the straight-line segment and the asymmetry, so is not an exact match.\nThe middle segment is very close to an arc.\nThe other segments are more problematic.\nThey have zero curvature at the endpoints, so are G2 continuous with flat sides, but there is a curvature discontinuity with the middle (arc) section, and their curvature profile is not especially smooth.\nA reasonable guess is that it was drawn by hand to be approximately smooth.\n\nWithout a flat side, the Figma squircle is only capable of a gauge between $\\sqrt{0.5}$ (0.707) and 0.854.\nGauges up to 1 are of course attainable by adding the flat side.\n\n## Clothoid squircles\n\nThe Figma blog suggests “smoothed curvature profiles” which have a piecewise linear relationship between arc length and curvature.\nIt then goes on to approximate them with cubic Bézier segments, but their approximation has fairly significant curvature discontinuities when joining to the circular arc.\nThe clothoid squircle is worth describing explicitly, as it has G2 continuity (as opposed to G1 for the Figma approximation).\n\nThe behavior is generally similar to the Figma variant.\nWithout a flat side, it is only capable of a gauge between $\\sqrt{0.5}$ (0.707) and 0.790.\n\n## The box decorations corner-shape spec\n\nSquircles got a big boost as they’re now standardized in CSS, as the [corner-shape](https://www.w3.org/TR/css-borders-4/#propdef-corner-shape) property of the [box decorations spec](https://www.w3.org/TR/css-borders-4/).\nThese specify real superellipse corners, with additional tweaks and support for animation.\n\n### The Chromium superellipse approximation\n\nWhile the CSS spec mandates the actual superellipse shape, practical implementations will generally use a Bézier approximation.\nA blog post, [The corner cases of implementing CSS corner-shape in Blink](https://developer.chrome.com/blog/implementing-corner-shape), gives an efficient closed-form approximation, with two Bézier segments per quadrant.\nThis formula, determined using symbolic regression, is parametrized, and handles exponents 2 and above well.\nIt is exact for placing the midpoint (this is part of the formula), so is well calibrated in that regard.\n\n### Apple-like behavior with the corner-shape spec\n\nThe early analysis of the Apple squircle shape as being approximately an exponent 5 superellipse was based on coarse shape only and didn't take into account its flat side.\nA much better match to the Apple shape is attainable using a superellipse with exponent 3 and a corresponding flat side length to match the gauge.\nThis has G2 continuity and a similar curvature profile.\nThis illustration was made using the Chromium approximation, so it should match the browser.\n\n![The Apple squircle beside a superellipse of exponent 3 with flat sides](https://linebender.org/wiki/curves/squircle/apple_vs_superellipse.svg)\n\nHere's the CSS to accomplish the \"close to Apple\" squircle shape.\nNote that the parameter to the `superellipse()` function is the base-2 log of the exponent, so the value for an exponent of 3 is 1.585.\n\n```\n.icon {\n  aspect-ratio: 1;\n  border-radius: 46.2%;\n  corner-shape: superellipse(1.585);\n}\n```\n\n## Continuity\n\nA superellipse of exponent $n$ has continuity $G(\\lceil n \\rceil - 1)$.\nThis includes the flat-sided variants, as, for exponent > 2, the endpoint of the quadrant has zero curvature.\nA perfect circle (and indeed, any even integer exponent) without flat sides is of course the exception, as it has an infinitely high order of continuity.\n\nAs a general observation, for visual smoothness, the shape should have G2 continuity.\nOf the variants discussed, only the clothoid and superellipse (for n > 2) have this property.\nThe Chromium approximation comes close; it doesn't have zero curvature by construction when joining the flat part, but does at the corner join by symmetry (unlike the Figma approximation, which has an additional arc there).\n\n## Other squircles\n\nQuite a number of other curves can be pressed into service as squircles if need be.\n\n- The polynomial spiral (“spiro”) curve can do a reasonable flat-sided squircle with G2 continuity.\n  See the “suitcase corners” section of [Raph's thesis](https://levien.com/phd/phd.html), figure 7.2.\n- Conic sections (hyperbolas).\n  These approximate a sharp corner but are only G1 continuous (if flat sided).\n- Fernández-Guasti squircle, defined by $x^2 + y^2 - s^2x^2y^2 = 1$.\n  This is used in engineering but likely not in graphic design.\n- The [Wikipedia page on squircles](https://en.wikipedia.org/wiki/Squircle) has a “periodic squircle” which has very similar behavior to the Fernández-Guasti one (they are visually near indistinguishable).\n\n## Related topics\n\nThe offset curve of a squircle is not a squircle, but (a) it’s close, and (b) concentric squircles might be visually just as appealing or more so; for example a slightly rounded inner corner might look better than a sharp one if the curvature exceeds the stroke half-width.\n\nThe [blurred rounded rectangle approximation](https://raphlinus.github.io/graphics/2020/04/21/blurred-rounded-rects.html) is based on applying shading to a superellipse; each iso-line is in fact a superellipse.\n","body_html":"<h1 id=\"squircles\">Squircles</h1>\n<p>A squircle is a shape intermediate between a square and a circle.\nThere is no single mathematical definition, rather there are a number of curves that fit this shape.\nAll general squircles are parametrized, and can vary between circle and square.</p>\n<h2 id=\"superellipse\">Superellipse</h2>\n<p>The best known squircle is the superellipse, popularized by Piet Hein.\nMartin Gardner wrote a detailed narrative of its origin in a <a href=\"https://archive.org/details/mathematicalcarn00gard/page/240/mode/2up\" rel=\"nofollow ugc noopener\">Scientific American column</a> in 1977.\nThe text is replicated in <a href=\"https://piethein.com/superellipse/\" rel=\"nofollow ugc noopener\">https://piethein.com/superellipse/</a> but that’s missing equations and figures.</p>\n<p>The superellipse has the formula $|x|^n + |y|^n = 1$ (we’ll use a unit radius for convenience).\nWhen $n=2$ it is a circle, and it approaches a square asymptotically as $n \\rightarrow \\infty$.</p>\n<h2 id=\"measurement\">Measurement</h2>\n<p>There is no standard measurement for squircles.\nFor superellipses, the exponent is the most common parameter.\nA good choice is the coordinates of the midpoint of the quadrant, assuming a unit radius; here $x$ and $y$ are equal.\nThe conversion formula is simple and intuitive: $x = 0.5^{1/n}$.\nThis measurement is called &quot;gauge&quot; in the interactive demo above, and is the primary parameter; with the exception of some unreachable regions of parameter space, it should be possible to compare different squircle variants with similar gauge.</p>\n<h2 id=\"flat-sided-squircles\">Flat-sided squircles</h2>\n<p>There are two basic approaches to squircle creation.\nOne is a single analytic curve, where curvature reaches zero at the poles, but is otherwise nonzero.\nThe other is mixing straight line segments with corners.\nA significant advantage of the latter approach is that it can adapt to rectangles of arbitrary aspect ratio without distorting the corner shape.</p>\n<h2 id=\"the-apple-squircle-shape\">The Apple squircle shape</h2>\n<p>Squircles received renewed attention when Apple changed the icon shape from rounded rectangle to their own squircle in iOS 7 in 2013.\nThere were several blog posts to analyze and recreate the shape.\nAn early analysis suggested that it was a superellipse of exponent 5, but when people extracted the Béziers and looked more closely, that was found to be inaccurate.\nRather, it’s a flat-sided squircle.</p>\n<p>For the raw Bézier path data of the Apple shape, the best source is the <a href=\"https://www.paintcodeapp.com/blogpost/code-for-ios-7-rounded-rectangles\" rel=\"nofollow ugc noopener\">PaintCode blog</a>.\nThis blog correctly points out some bugs in that logic, and also has some details on behavior for oval rather than square aspect ratios.</p>\n<p>The Apple shape has a number of flaws, including one extraneous straight line segment, and a lack of symmetry.\nHowever, those flaws are minor, and really only reveal themselves under close analysis.</p>\n<p>The Apple shape has no additional parameter, so its variation is controlled entirely by the length of the flat side.\nWith no flat side, it has a gauge fixed at 0.809.</p>\n<p>An extremely detailed analysis of the Apple shape is in <a href=\"https://tsuijunxi.github.io/en/2026/06/23/the-art-of-continuous-corners/\" rel=\"nofollow ugc noopener\">The Art of Continuous Corners</a>.</p>\n<h2 id=\"the-figma-squircle\">The Figma squircle</h2>\n<p>Figma published a blog post, <a href=\"https://www.figma.com/blog/desperately-seeking-squircles/\" rel=\"nofollow ugc noopener\">Desperately Seeking Squircles</a>, with an analysis of the Apple squircle and their own approximation.\nIt is influential because Figma is an important design tool, because their writeup was compelling, and because there are any number of open source implementations of it, mostly TypeScript/JavaScript.</p>\n<ul><li><a href=\"https://msurguy.github.io/squircle-path-kit/\" rel=\"nofollow ugc noopener\">squircle-path-kit</a> from msurguy</li><li><a href=\"https://github.com/phamfoo/figma-squircle\" rel=\"nofollow ugc noopener\">figma-squircle</a> from phamfoo<ul><li><a href=\"https://github.com/sanalabs/corner-smoothing\" rel=\"nofollow ugc noopener\">corner-smoothing</a> from sanalabs (uses figma-squircle)</li><li><a href=\"https://github.com/bring-shrubbery/squircle-js\" rel=\"nofollow ugc noopener\">squircle-js</a> from bring-shrubbery (uses figma-squircle)</li></ul></li><li><a href=\"https://github.com/aloisdeniel/figma_squircle\" rel=\"nofollow ugc noopener\">figma_squircle</a> from aloisdeniel (Dart/Flutter)</li><li><a href=\"https://github.com/JaceThings/Lisse\" rel=\"nofollow ugc noopener\">Lisse</a> from JaceThings</li></ul>\n<p>The Figma blog contains a plot of the Béziers comprising a cleaned up version of iOS 7 rounded rectangle, revealing three Bézier segments per quadrant.\nIt fixes the straight-line segment and the asymmetry, so is not an exact match.\nThe middle segment is very close to an arc.\nThe other segments are more problematic.\nThey have zero curvature at the endpoints, so are G2 continuous with flat sides, but there is a curvature discontinuity with the middle (arc) section, and their curvature profile is not especially smooth.\nA reasonable guess is that it was drawn by hand to be approximately smooth.</p>\n<p>Without a flat side, the Figma squircle is only capable of a gauge between $\\sqrt{0.5}$ (0.707) and 0.854.\nGauges up to 1 are of course attainable by adding the flat side.</p>\n<h2 id=\"clothoid-squircles\">Clothoid squircles</h2>\n<p>The Figma blog suggests “smoothed curvature profiles” which have a piecewise linear relationship between arc length and curvature.\nIt then goes on to approximate them with cubic Bézier segments, but their approximation has fairly significant curvature discontinuities when joining to the circular arc.\nThe clothoid squircle is worth describing explicitly, as it has G2 continuity (as opposed to G1 for the Figma approximation).</p>\n<p>The behavior is generally similar to the Figma variant.\nWithout a flat side, it is only capable of a gauge between $\\sqrt{0.5}$ (0.707) and 0.790.</p>\n<h2 id=\"the-box-decorations-corner-shape-spec\">The box decorations corner-shape spec</h2>\n<p>Squircles got a big boost as they’re now standardized in CSS, as the <a href=\"https://www.w3.org/TR/css-borders-4/#propdef-corner-shape\" rel=\"nofollow ugc noopener\">corner-shape</a> property of the <a href=\"https://www.w3.org/TR/css-borders-4/\" rel=\"nofollow ugc noopener\">box decorations spec</a>.\nThese specify real superellipse corners, with additional tweaks and support for animation.</p>\n<h3 id=\"the-chromium-superellipse-approximation\">The Chromium superellipse approximation</h3>\n<p>While the CSS spec mandates the actual superellipse shape, practical implementations will generally use a Bézier approximation.\nA blog post, <a href=\"https://developer.chrome.com/blog/implementing-corner-shape\" rel=\"nofollow ugc noopener\">The corner cases of implementing CSS corner-shape in Blink</a>, gives an efficient closed-form approximation, with two Bézier segments per quadrant.\nThis formula, determined using symbolic regression, is parametrized, and handles exponents 2 and above well.\nIt is exact for placing the midpoint (this is part of the formula), so is well calibrated in that regard.</p>\n<h3 id=\"apple-like-behavior-with-the-corner-shape-spec\">Apple-like behavior with the corner-shape spec</h3>\n<p>The early analysis of the Apple squircle shape as being approximately an exponent 5 superellipse was based on coarse shape only and didn&#39;t take into account its flat side.\nA much better match to the Apple shape is attainable using a superellipse with exponent 3 and a corresponding flat side length to match the gauge.\nThis has G2 continuity and a similar curvature profile.\nThis illustration was made using the Chromium approximation, so it should match the browser.</p>\n<figure><img src=\"https://linebender.org/wiki/curves/squircle/apple_vs_superellipse.svg\" alt=\"The Apple squircle beside a superellipse of exponent 3 with flat sides\" loading=\"lazy\" decoding=\"async\" referrerpolicy=\"no-referrer\" /></figure>\n<p>Here&#39;s the CSS to accomplish the &quot;close to Apple&quot; squircle shape.\nNote that the parameter to the <code>superellipse()</code> function is the base-2 log of the exponent, so the value for an exponent of 3 is 1.585.</p>\n<pre><code>.icon {\n  aspect-ratio: 1;\n  border-radius: 46.2%;\n  corner-shape: superellipse(1.585);\n}</code></pre>\n<h2 id=\"continuity\">Continuity</h2>\n<p>A superellipse of exponent $n$ has continuity $G(\\lceil n \\rceil - 1)$.\nThis includes the flat-sided variants, as, for exponent &gt; 2, the endpoint of the quadrant has zero curvature.\nA perfect circle (and indeed, any even integer exponent) without flat sides is of course the exception, as it has an infinitely high order of continuity.</p>\n<p>As a general observation, for visual smoothness, the shape should have G2 continuity.\nOf the variants discussed, only the clothoid and superellipse (for n &gt; 2) have this property.\nThe Chromium approximation comes close; it doesn&#39;t have zero curvature by construction when joining the flat part, but does at the corner join by symmetry (unlike the Figma approximation, which has an additional arc there).</p>\n<h2 id=\"other-squircles\">Other squircles</h2>\n<p>Quite a number of other curves can be pressed into service as squircles if need be.</p>\n<ul><li><p>The polynomial spiral (“spiro”) curve can do a reasonable flat-sided squircle with G2 continuity.</p><p>See the “suitcase corners” section of <a href=\"https://levien.com/phd/phd.html\" rel=\"nofollow ugc noopener\">Raph&#39;s thesis</a>, figure 7.2.</p></li><li><p>Conic sections (hyperbolas).</p><p>These approximate a sharp corner but are only G1 continuous (if flat sided).</p></li><li><p>Fernández-Guasti squircle, defined by $x^2 + y^2 - s^2x^2y^2 = 1$.</p><p>This is used in engineering but likely not in graphic design.</p></li><li>The <a href=\"https://en.wikipedia.org/wiki/Squircle\" rel=\"nofollow ugc noopener\">Wikipedia page on squircles</a> has a “periodic squircle” which has very similar behavior to the Fernández-Guasti one (they are visually near indistinguishable).</li></ul>\n<h2 id=\"related-topics\">Related topics</h2>\n<p>The offset curve of a squircle is not a squircle, but (a) it’s close, and (b) concentric squircles might be visually just as appealing or more so; for example a slightly rounded inner corner might look better than a sharp one if the curvature exceeds the stroke half-width.</p>\n<p>The <a href=\"https://raphlinus.github.io/graphics/2020/04/21/blurred-rounded-rects.html\" rel=\"nofollow ugc noopener\">blurred rounded rectangle approximation</a> is based on applying shading to a superellipse; each iso-line is in fact a superellipse.</p>","headings":[{"level":1,"text":"Squircles","id":"squircles"},{"level":2,"text":"Superellipse","id":"superellipse"},{"level":2,"text":"Measurement","id":"measurement"},{"level":2,"text":"Flat-sided squircles","id":"flat-sided-squircles"},{"level":2,"text":"The Apple squircle shape","id":"the-apple-squircle-shape"},{"level":2,"text":"The Figma squircle","id":"the-figma-squircle"},{"level":2,"text":"Clothoid squircles","id":"clothoid-squircles"},{"level":2,"text":"The box decorations corner-shape spec","id":"the-box-decorations-corner-shape-spec"},{"level":3,"text":"The Chromium superellipse approximation","id":"the-chromium-superellipse-approximation"},{"level":3,"text":"Apple-like behavior with the corner-shape spec","id":"apple-like-behavior-with-the-corner-shape-spec"},{"level":2,"text":"Continuity","id":"continuity"},{"level":2,"text":"Other squircles","id":"other-squircles"},{"level":2,"text":"Related topics","id":"related-topics"}]}}