What is a CSS pattern generator?
A CSS pattern generator creates repeating background patterns using only CSS, without image files. Patterns like dots, grids and stripes add texture to empty areas, mark up diagrams and give pages a crafted, intentional feel.
Choose from eleven patterns, including polka dots, offset dots, grid lines, graph paper, checkerboard, diagonal, horizontal and vertical stripes, zigzag, plus signs and lined paper. Set the colours, spacing, line or dot thickness and opacity, preview it across the full width of the page, and copy the CSS.
How to use the CSS pattern generator
1.Pick a pattern
Eleven patterns, from polka dots to graph paper.
2.Set colours and size
Pattern and background colours, spacing, thickness and opacity.
3.Copy the CSS
Paste it onto any element's background.
Example: dotted background for a hero
Polka dots at the default settings:
- Pattern
- Polka dots
- Spacing
- 24px
- Dot size
- 3px
- Colours
- blue at 60% on #f6f7fa
An even field of small blue dots behind a heading, drawn entirely by CSS.
No image files
Every pattern is drawn by the browser from CSS gradients, so there's nothing extra to download, it's sharp on high-resolution screens, and colours can be changed later by editing the CSS. Plus signs use a tiny inline SVG instead, written into the same CSS.
Lowering the pattern opacity is the easiest way to make it subtle enough to sit behind text. Graph paper and lined paper suit note-taking apps, while dots and grids work well behind diagrams and empty states.
Frequently asked questions
Will the pattern line up across sections?
Patterns start from each element's corner. Give sections the same background-position if you need them aligned.
Can I layer a pattern over a gradient?
Yes. Add your gradient as another value in background-image.
Does it work in old browsers?
All current browsers support it. The checkerboard uses conic-gradient, which very old browsers lack.
Can I share a pattern?
Yes. Settings are saved in the page address.
Related tools
CSS Gradient Generator
Linear, radial and conic gradients with up to six stops.
Noise texture generator
Seamless grain and noise textures as PNG tiles or SVG CSS.
Blob generator
Random smooth organic shapes as SVG or CSS clip-path.
CSS Box-Shadow Generator
Layered, inset and soft shadows with a live preview.
CSS Border-Radius Generator
Rounded corners, linked or per-corner, in px or %.
CSS clamp() Generator for Fluid Sizes
Fluid font sizes and spacing that scale between two viewport widths.
More Developer tools
JSON & data
CSV tools
Network & system
Web & API
Git & releases
Encoding & security
- Base64 encode & decode
- URL encode & decode
- JWT decoder
- Hash generator
- HTML entity encoder
- Text to binary
- Morse code translator
- Caesar cipher & ROT13
- Random string generator
- Secret key generator
- 2FA code generator (TOTP)
- Encrypt & decrypt text
- Encrypt & decrypt files
- SSH key generator
- Base32 encoder and decoder
- Unicode escape converter
- Nano ID generator
- JWT generator
Text & code
- Regex tester
- Text diff checker
- Cron expression explainer
- Lorem ipsum generator
- Markdown previewer
- Slug generator
- Strip HTML tags
- Unicode character inspector
- URL parser
- Markdown TOC generator
- cURL converter
- Whitespace visualizer
- Markdown link extractor
- Regex escape
- Regex match extractor
- Split text by regex
- HTML, CSS and JS playground
- Mock data generator
- Keyboard event tester
- ASCII table