CSS Pattern Generator

Create pure-CSS background patterns: stripes, diagonal stripes, dots, offset polka dots, grid, checkerboard and zigzag. Pick two colours and a size and copy the CSS.

Use the tool

Why this tool exists

Subtle patterns add texture to a hero section, card or empty state without an image request. They are built from repeating gradients, but the syntax is hard to remember, especially for checkerboards and zigzags that layer four gradients with offset positions.

Choose a pattern type, a pattern colour and a background colour, and set the tile size. The tool writes the background-color, background-image, background-size and background-position declarations and shows the result in a preview. Because the patterns are CSS, they scale without blur, change with a variable and add no download weight. Very large or complex gradients can slow painting on low-end devices, so keep tile sizes sensible. Nothing is uploaded.

How to use it

  1. Choose a pattern type from the list.
  2. Pick the pattern colour and the background colour, and set the size in pixels.
  3. Check the preview panel.
  4. Copy the CSS onto the element you want to decorate.

Frequently asked questions

Does it use images?

No. Every pattern is built from CSS gradients, so there is no file to download and the pattern stays sharp at any zoom level.

How do I make the pattern subtler?

Choose two colours that are close in tone, or use a semi-transparent pattern colour. You can also lay the pattern on a plain element and lower its opacity.

Can I change the pattern size later?

Yes. The size appears in background-size and in the gradient stops. Regenerate with a new size, or define the size in a CSS variable if you want to change it with media queries.

Is performance a concern?

Simple patterns are cheap. Many layers over a large area, such as a checkerboard with a tiny tile, can be slower to paint on weak devices, so test on mobile.