CSS Pattern Generator
Create pure CSS background patterns – dots, polka dots, stripes, checkerboard, grid, zigzag and crosshatch – with colors, tile size and thickness. No images.
Pattern settings
Preview
background-color: #ffffff; background-image: radial-gradient(#6366f1 2px, transparent 2px); background-size: 20px 20px;
Related Tools
View AllWhat is CSS Pattern Generator?
Generates repeating background patterns using only CSS gradients, so no image files are needed. Choose a pattern, two colours, the tile size and line or dot thickness, and copy the resulting background declarations.
How to use CSS Pattern Generator
- Choose a Pattern: Dots, Polka dots, Stripes, Checkerboard, Grid, Zigzag or Crosshatch grid.
- Set the Pattern color and Background color.
- Adjust Tile size and the thickness (dot radius, stripe width or line width) and, for stripes, the Angle.
- Check the preview.
- Copy the CSS code.
Example
Checkerboard, tile 40px, pattern #000000 on #ffffff
background-color: #ffffff; background-image: repeating-conic-gradient(#000000 0% 25%, transparent 0% 50%); background-size: 40px 40px;
When to use CSS Pattern Generator
Use CSS patterns for subtle page backgrounds, placeholders, graph-paper effects and decorative sections; they scale perfectly and cost no HTTP request. For complex or illustrative repeating artwork, an SVG tile is more flexible.
How CSS Pattern Generator works
Every pattern is a background-color plus one or more gradients repeated by background-size. Dots use radial-gradient(color r, transparent r); polka dots add a second offset layer via background-position. Stripes use repeating-linear-gradient with hard colour stops; the checkerboard uses repeating-conic-gradient(color 0% 25%, transparent 0% 50%); grids combine a horizontal and a vertical linear gradient; zigzag is built from four 45° triangles. Thickness is limited to the tile size.
Common Use Cases
- Graph-paper backgrounds for editors and diagrams
- Subtle dotted hero backgrounds
- Striped warning or progress bars
- Transparency checkerboards behind images
- Retro zigzag section backgrounds
FAQs
Do these patterns work in all browsers?
Yes in current browsers. The checkerboard relies on conic gradients, supported by all major browsers since 2020.
Can I use a transparent background?
Yes, enter transparent or an rgba()/oklch() colour with alpha as the Background color.
Why use CSS instead of an image?
CSS patterns are resolution independent, tiny, and easy to recolour with variables, with no extra file to download.