CSS Background Pattern Generator

Create repeating background patterns with pure CSS gradients.

Preview

Settings

Pattern
StripesCrosshatchGridIsometricCheckerboardTrianglesDiamondsZigzagWavesDotsRingsRipples
Colors
Shape
Output
CSSTailwind@utility
background-color: #18181b;
background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 24px);

Paste into a stylesheet rule or an inline style.

What is the CSS Background Pattern Generator?#

The CSS Background Pattern Generator turns a few settings into a repeating background pattern written in plain CSS gradients. Choose from twelve styles — stripes, grids, dots, waves, and more — set the colors and scale, and copy the finished code.

Every pattern is drawn with gradients, so the result stays sharp at any size and needs no image files. The snippet can be pasted into a stylesheet or an inline style.

How to Use#

  1. Pick a pattern from the twelve tiles.
  2. Set the pattern color and the background color.
  3. Adjust the size, and the thickness or angle where the pattern supports them.

The preview updates as you change the settings, so you can tune the scale and contrast until the background fits. The result can be copied as plain CSS, Tailwind classes, or a Tailwind v4 utility.

Options#

  • Pattern: twelve repeating styles, from thin diagonal lines to waves and ripples.
  • Pattern color / Background color: the two colors the pattern is built from.
  • Swap: exchanges the two colors in one click.
  • Pattern opacity: makes the pattern color semi-transparent so it blends into the background.
  • Pattern size: the size of one tile in pixels. Smaller values give a finer texture. The values are written in px, so replace them with em or % in the copied CSS if the pattern should scale with the element.
  • Thickness: the line width or dot radius, from thin hatching to bold bands. Available on patterns drawn with lines or dots.
  • Angle: the rotation of the pattern. Available on stripes and crosshatch.
  • Overlay: a finishing gradient painted over the pattern. Bottom fade eases the pattern out toward the bottom, spotlight keeps the center clear, and vignette softens the corners.
  • Overlay strength: how far the fade runs before it reaches the background color. A higher value spreads the transition further, so more of the pattern stays visible.

Common Use Cases#

  • Hero sections that need a texture behind the headline.
  • Card and empty-state backgrounds that should stay quiet.
  • CSS-only texture for buttons, badges, and thumbnails.
  • Fading a pattern toward the bottom so text stays readable.

FAQ#

Notes#

  • Patterns are drawn entirely with CSS gradients. No images or external requests are involved.
  • Switching patterns keeps the colors, opacity, size, and thickness you have set.
  • The overlay is painted with the background color, so changing that color changes the fade as well.
  • Generator

Last updated:

Related tools