Random Shape Generator

Generates a random polygon with a random number of sides (3 to 10), random size, rotation, and fill color, rendered as a live SVG preview with a downloadable .svg file. Each vertex's radius is jittered slightly around a base radius, producing an organic, sometimes star-ish silhouette rather than a perfectly regular polygon every time. A free online tool from Staaarter, right in your browser.

Runs locallyUpdated 2026-07-26

Overview

Introduction

This tool generates a random polygon shape, rendered live as SVG, with a random number of sides, size, rotation, and fill color.

Every click of Regenerate produces a fresh shape, useful for quick placeholder art, design inspiration, or testing how your app handles arbitrary SVG shapes.

What Is Random Shape Generator?

A generator that draws a random polygon with 3 to 10 sides, using a slightly jittered vertex radius around a random base size, at a random rotation, filled with a random color.

The result is rendered directly as an SVG <polygon> element, previewed live on the page and available to copy or download as a standalone .svg file.

How Random Shape Generator Works

The tool picks a random side count (3 to 10), a random base radius, and a random overall rotation for the shape.

Each vertex is placed at an angle evenly spaced around the center, but with its distance from the center independently jittered between 75% and 100% of the base radius.

A random fill color (as an HSL color string) is applied, and the result is serialized into a single self-contained SVG string.

When To Use Random Shape Generator

Use it to quickly generate placeholder shape art for a mockup, background decoration, or design prototype.

It's also useful for testing how an SVG-consuming component (an icon system, image processor, or vector editor) handles arbitrary polygon shapes.

Features

Advantages

  • Produces a fresh, self-contained SVG string every time, ready to preview, copy, or download.
  • Randomized vertex jitter gives each shape a distinct, organic silhouette instead of a repetitive regular polygon.
  • No external dependencies; the SVG is generated as plain markup.

Limitations

  • The polygon is not guaranteed to be strictly convex; heavy vertex jitter can occasionally create a slightly star-like or self-intersecting outline.
  • Side count, size, and rotation are all randomized together; you can't currently lock one property while re-randomizing the others.
  • The canvas is a fixed 300x300 SVG viewBox, not resizable from the UI.

Examples

A random hexagon-ish shape

Input

(no input; generated from settings: sides=6, randomized size/rotation/color)

Output

<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><polygon points="..." fill="hsl(210, 70%, 55%)" stroke="#1f2937" stroke-width="2" /></svg>

The exact point coordinates vary every time since the base radius, rotation, and per-vertex jitter are all random.

A random pentagon

Input

(no input; generated from settings: sides=5, randomized size/rotation/color)

Output

<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 300 300"><polygon points="..." fill="hsl(35, 70%, 55%)" stroke="#1f2937" stroke-width="2" /></svg>

Best Practices & Notes

Best Practices

  • Click Regenerate a few times if you're looking for a specific silhouette; the shape varies significantly with each roll.
  • Download the SVG file directly if you need to edit it further in a vector graphics editor.

Developer Notes

Vertex radius jitter is computed as `baseRadius * (0.75 + 0.25 * rng())` per vertex, which is what produces the organic/star-ish silhouette instead of a perfectly regular polygon; the shape is otherwise a standard angle-evenly-spaced polygon construction.

Random Shape Generator Use Cases

  • Generating placeholder shape art for a design mockup or prototype
  • Testing an SVG-consuming component with arbitrary random polygon input
  • Producing quick decorative background shapes for a webpage

Common Mistakes

  • Assuming the shape is always perfectly convex; heavy random jitter can occasionally produce a slightly star-like outline.
  • Expecting to control the side count from the UI; the shipped tool fully randomizes it on every regenerate.
  • Forgetting to download or copy the SVG before regenerating, losing the current shape.

Tips

  • Use the Random Circle Generator instead if you specifically want a perfect circle rather than a polygon.
  • Combine with the Random Line Generator's SVG output in a design tool for a quick abstract composition.

References

Frequently Asked Questions