CSS Pattern Generator

Build repeating geometric backgrounds — stripes, dots, grids, checks — and copy the CSS.

Ad placeholder (leaderboard)
Enjoying the tools? Go Pro for £4.99 (one-time) and remove all ads — forever, on this device. Remove ads — £4.99

The CSS Pattern Generator builds repeating geometric backgrounds entirely from CSS gradients — horizontal and diagonal stripes, polka dots, line grids, graph paper, checkerboards and cross-hatch — and hands you clean, copy-ready CSS. It is made for front-end developers, designers and anyone who wants a lightweight decorative background without shipping an image file. Pick a pattern, choose two colours, drag a few sliders, and watch a live preview update instantly; when it looks right, copy the rule or download a pattern.css file. Because every pattern is pure CSS, it stays perfectly sharp on retina displays, weighs essentially nothing, and never triggers an extra network request.

How it works

Each pattern is composed from one or more repeating gradients layered over a solid background colour. Stripes use a repeating-linear-gradient that paints a coloured band of your chosen thickness and then a transparent gap, repeating across the tile. Diagonal stripes are the same idea rotated to your chosen angle. The line grid and graph paper styles stack two perpendicular gradient sets, while the checkerboard overlaps two diagonal gradients offset by half a tile using background-position. Polka dots are drawn with a radial-gradient repeated on a tile, and cross-hatch crosses two diagonal stripe layers. The tile size, line or dot weight, foreground opacity and (for diagonal stripes) the angle are all live controls, so you can dial in the exact density and contrast you need. The opacity slider converts your foreground hex to an rgba() value, letting you create bold motifs or whisper-quiet textures from the same controls. Your settings persist in localStorage, so the tool reopens exactly where you left off.

Example

Suppose you want a subtle blueprint texture behind a hero section. Choose the Blueprint preset: a deep blue base with thin light-blue grid lines at 60% opacity on a 28px tile. The generator produces a four-line CSS rule you can drop straight onto a section or a div. Want it bolder? Push the line thickness up and the opacity to 100%. Prefer dots? Switch to Polka, set the dot size, and the same workflow gives you a crisp dotted field. A typical output looks like this:

.pattern {
  background-color: #0b3d91;
  background-image: repeating-linear-gradient(0deg, #9fc3ff 0, #9fc3ff 1px, transparent 1px, transparent 28px), repeating-linear-gradient(90deg, #9fc3ff 0, #9fc3ff 1px, transparent 1px, transparent 28px);
  background-size: 28px 28px;
  background-position: 0 0;
}

Paste it into your stylesheet, change the selector to match your element, and the pattern renders instantly — no image asset, no build step, no dependency. Every value updates live as you experiment, so iterating from a rough idea to a polished background takes seconds.

Ad placeholder (rectangle)