CSS Background Pattern Generator
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
Pick a pattern
Click a pattern thumbnail such as Dots, Grid or Hexagons.
- 2
Adjust it
Set scale, line width, rotation, opacity and the colours.
- 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
Related tools
- Background GeneratorWallpapers and backgrounds from gradients, mesh, patterns and grain, at phone, desktop, 4K and social sizes.
- Noise Texture GeneratorGrain and noise textures as a PNG tile or a tiny inline SVG for CSS.
- CSS Gradient GeneratorLinear, radial and conic CSS gradients with a live preview.
- Blob GeneratorRandom organic SVG blob shapes with gradients, as SVG, PNG or CSS border-radius.