Design tools

CSS Pattern Generator

CSS Background Pattern Generator

Copy-ready CSS background patterns: dots, grids, stripes, waves and more.

About this tool

About CSS Pattern Generator

Give a section, card or full page a patterned background using nothing but CSS. Choose one of twelve seamless patterns, from polka dots, a graph-paper grid and pinstripes to waves, zigzags, triangles, crosses, hexagons, diamonds and rings, then set the scale, line width, angle, opacity and colours. The generator writes a background-color and a background-image that embeds the pattern as a compact, URL-encoded SVG, with background-size set to one tile so the browser repeats it. There's no image file to host, the CSS works in every modern browser, and because it's vector, it stays crisp on high-density screens. Rotated patterns are handled with a full-size SVG pattern so they still tile without seams. Make the background transparent to layer the pattern over a gradient or photo. The SVG and a PNG export are there too if you need them. Generated in your browser.

Built and maintained by Abhi JainUpdated

Recent changes

  • Add pattern preview transparency indicator and resume pdf tests

How to Create a CSS Background Pattern

  1. 1

    Pick a pattern

    Click a pattern thumbnail such as Dots, Grid or Hexagons.

  2. 2

    Adjust it

    Set scale, line width, rotation, opacity and the colours.

  3. 3

    Copy the CSS

    Copy the CSS tab and paste it into the element's styles.

CSS Pattern Generator: questions and answers

How do I make a dotted background in CSS?

Choose Dots, set the scale for spacing and the dot radius, then copy the CSS. It repeats a tiny SVG tile with one dot.

Can I combine the pattern with a gradient?

Yes. Tick Transparent background, then list the pattern before your gradient: background-image: url("data:…"), linear-gradient(…).

Is a CSS pattern better than an image?

For simple geometry, yes: the data URI is usually under 1 KB, needs no extra request and stays sharp at any zoom level.

Do these patterns work in all browsers?

SVG data URIs in background-image work in all modern browsers, including Safari on iOS.

More Pattern Generator presets