UTILS.
Private by default
▩

CSS Background Pattern

Generate a CSS background pattern with two colours and copy it.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

CSS Background Pattern Generator makes a repeating pattern using only CSS gradients, so there is no image file to download. Choose stripes, checkerboard, dots or grid, pick two colours and set the tile size from 8 to 80 pixels. The preview box updates as you change anything, and the code is one click away from your clipboard.

The copied code is a set of background declarations with no selector, so paste it into any rule. Stripes use repeating-linear-gradient at 45 degrees, with each band half the size value wide and the two colours alternating. Checkerboard layers four linear gradients with colour 1 squares on a colour 2 base, using a background-size of twice the size value and matching background-position offsets. Dots draws a radial-gradient circle in colour 1, repeated every size pixels over colour 2. Grid draws 1px lines in colour 1 over colour 2 with two perpendicular linear gradients, so the size value sets the gap between lines while the line thickness stays 1px.

Because the pattern is built from gradients, it stays sharp at any zoom level and adds no extra request. Colours come from colour pickers, so they are solid hex values with no transparency. For soft overlays, edit the copied code and swap in rgba() colours. To change the stripe angle, edit the 45deg value in the output.

Frequently asked questions

How are these patterns made without images?
They use CSS linear and radial gradients with background-size, which the browser tiles to draw the repeating pattern.
Will the pattern scale on high-density screens?
Yes — gradients are vector based, so the pattern stays crisp at any resolution or zoom level.
Can I use transparent or semi-transparent colours?
Not from the pickers, which give solid colours. Paste the code into your stylesheet and replace a hex value with an rgba() colour to let what is behind show through.
How do I change the stripe angle or line thickness?
Edit the copied CSS. The stripe angle is the 45deg value in repeating-linear-gradient, and the grid lines use a fixed 1px thickness that you can change in both gradients.

More tools