October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
ThatPainter
rounded rectangle

Rounded Rectangle: Shape, Geometry, and SVG

A rounded rectangle has curved corners. In SVG, its element uses rx and ry to set the horizontal and vertical corner radii.

By ThatPainter Team 2 min read
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

ThatPainter is reader-supported. When you buy through links on our site, we may earn an affiliate commission. Learn More

A rounded rectangle is a rectangle with curved corners. In SVG, make one with a <rect> element and set its rx and ry corner radii. Those attributes control the curves along the rectangle’s horizontal and vertical axes; equal values make circular corner arcs, while different values make elliptical arcs.

What makes a rectangle rounded?

A standard rectangle has square corners. A rounded rectangle replaces each corner with a curved arc while keeping straight edges between the arcs. In SVG, rounded rectangles are still rectangles: the <rect> element describes the shape, and its corner radii determine whether the corners are square or curved. The W3C SVG 2 specification defines the geometry.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How do rx and ry work in SVG?

rx is the horizontal radius of the corner arcs, and ry is the vertical radius. Together they define elliptical arcs at the rectangle’s corners. Set both to the same non-zero value for circular arcs; use different values for elliptical arcs. SVG 2 describes rounded rectangles as being achieved by setting non-zero values for these geometric properties.

For example, this draws a 160-by-80 rectangle with 12-unit corner radii:

#1 Best Overall
Sale
Otoolling Metal Stencil Square Rectangle Template Stainless Steel for DIY
  • Product Includes: you will receive a stainless steel template with different square patterns, rich pattern selection can help you create unique and personalized crafts
  • Suitable Size: planner stencils templates are about 20 cm wide, about 18.5 cm long, and about 0.8 mm thick; , moderate thickness and not easy to deform
  • Ideal Material: calendar stencils for planners are made of qualified stainless steel, which is strong and reliable, not easy to rust or corrode, not easy to bend or deform; It can be used for a long time
  • Design Features: our square planner templates come in a variety of sizes, allowing you to draw square and rectangular patterns in a variety of sizes; You can make short sketches, drawings, doodles, artwork, paintings, and design projects
  • Wide Range of Applications: our journal templates are very suitable for drawing on diaries, journals, scrapbook supplies, notebooks, cards, and creating unique handicrafts; They can also be applied to various surfaces such as wood, canvas, fabric, glass, tiles, walls, greeting cards, etc. Some parts of the product are sharp, please be careful when using it and keep it out of reach of children

<svg xmlns="http://www.w3.org/2000/svg" width="160" height="80">
  <rect x="5" y="5" width="150" height="70" rx="12" ry="12" fill="none" stroke="black" />
</svg>

The MDN reference for <rect> also demonstrates rounding with rx.

What happens if a radius is omitted, zero, or too large?

Omitting one radius

SVG 1.1 specifies that if one valid radius is provided and the other is omitted, the omitted radius takes the provided value. For example, <rect width="100" height="60" rx="10" /> uses the same effective value for both radii under that rule. See the SVG 1.1 shape rules.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
UNICRAFTALE Metal Stencil Square Cutouts Stencil Rectangle Template Stainless Steel Journal Stencils Geometric Template Painting Stencils for DIY Scrapbooking Photo Engraving Jewelry
  • Product Details: You will receive 1pcs stencils with different square patterns, about 20cm wide, 18.5cm long, 0.5mm thick. The rich patterns choices can help you create unique and personalized crafts.
  • Square Metal Stencil: Our square template have a variety of sizes, which can draw rich sizes of square and rectangle shapes pattern, you can do short sketches, drawings, doodles, artwork, paintings, and design projects.
  • Wide Range of Application: All kinds of patterns journal stencil are perfect for drawing on diaries, journals, scrapbooking supplies, notebooks, cards to create unique handicrafts. And also can be applied to various surfaces such as wood, canvas, fabric, glass, tiles, walls, greeting cards, etc.
  • Stainless Steel Material: The mixed shape template is made of premium stainless steel material, sturdy and reliable, not easy to rust or corrosion, not easy to bend or deformation. It can be used for a long time.
  • Ideal Gift: These geometric patterns templates are exquisite and beautiful, making them ideal gifts for your family, friends, classmates and DIY enthusiasts on Halloween, Thanksgiving, Christmas, New Year and other holiday

Setting a radius to zero

Under SVG 2, if the computed value of either radius is zero, the rectangle has square corners. If both radii are auto, both used radii are zero. The MDN rx reference describes the attribute and its SVG behavior.

Using radii larger than the rectangle allows

SVG 1.1 limits effective radii so they cannot produce negative straight segments: a radius is clamped when it exceeds half the corresponding rectangle dimension. Thus, increasing a radius beyond that limit does not keep expanding the curve indefinitely.

Rank #3
Mvchifay Cutting Dies Metal Stencils Scrapbooking Tool DIY Craft Carbon Steel Embossing Template for Paper Card Making (Rounded Rectangle Frame-112x142mm)
  • Metal Material: Craft cutting dies is made of good quality hard carbon steel, durable and strong for longtime use
  • Retain Memory: You can use the cutting dies stencil to diy unique paper scrapbooking for commemorating great memories of life
  • Suitable for: Unique embossing cutting dies will be a perfect gift for friends, scrapper and card maker, it also can be a wonderful handmade tool for children to develop their creativity
  • Multiple Usage: Metal cutting dies is perfect for paper crafts, album decoration, card making, photo scrapbooking, etc
  • Package Include: The cutting dies set contains 5 pcs metal stencils. Size: 10.6*10.6cm

Can each corner have a different radius?

No—not with the rx and ry geometry of a single SVG <rect>. SVG 2’s rounded-rectangle arcs are symmetrical across the horizontal and vertical axes, so the corners follow the same rounding pattern. For individually shaped or uneven corners, define the outline with an SVG <path> instead.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Does this definition apply in every drawing app?

“Rounded rectangle” generally means a rectangle with curved corners, but the details above describe SVG, not a universal rule for every graphics application. Software may expose different controls or terminology. When precision matters, check the application’s documentation for how it handles corner radii and uneven corners.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
ORIGACH Stainless Stainless Steel Rectangle Round Template
  • Rectangle Round Templates: It includes 1 stainless steel template containing commonly used sizes of circles, rectangles, polygons, line frames, and arcs, all marked with precise values, making it very convenient to use and a professional drawing tool
  • Suitable Size: The template measures 15 × 13 cm / 5.91 × 5.12 inches and has specific size markings on the sides. It comes in a variety of shapes to meet your diverse pattern drawing needs
  • Quality Material: Made of high-quality stainless steel, it has high strength, ensuring long-term use without worry
  • Portable: It is moderately sized, easy to hold, and can be easily placed in a toolbox or backpack without taking up too much storage space, making it ideal for carrying around
  • Multi-Purpose: Widely applicable to various surfaces and most fabrics, such as leather, wood, glass, linen, tiles, metal, paper, etc., suitable for leatherwork, sewing projects, and other DIY crafts
Rank #4
UNICRAFTALE Mix Shape Metal Stencil Cutouts Cutting Stencils Round Rectangle Teardrop Template Stainless Steel Reusable Decorative Stencils Embossing Drawing for Bracelets Earrings Making Jewelry
  • Durable Construction: The round rectangle teardrop carbon steel cutting dies stencils made from high-quality carbon steel , these dies are built to last through countless uses.
  • Size Detail: The round rectangle teardrop carbon steel cutting dies stencils about 178mm wide, 127mm long, 0.5mm thick.which are convenient for daily use and will not occupy much space.
  • Intricate Design: The round rectangle teardrop theme about featuring an intricate design, this metal cutting die creates beautiful embossed and cut-out patterns.
  • Easy to Use: The round rectangle teardrop theme about simply place the die on your desired material and run it through a die-cutting machine for precise cuts.
  • Multi-Purpose: Suitable for congratulations, birthday, wedding, and blessing cards, adding a touch of elegance.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

More from the Paint Desk

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.