CSS Background Pattern Generator

Generate background patterns for CSS and Tailwind

Settings

Pattern Type

Colors

%

Shape

px
px
°

Overlay

Preview

Output
background-color: #18181b;
background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 20px);

What is CSS Background Pattern Generator?

CSS Background Pattern Generator creates repeating backgrounds with CSS background-image and shows the preview and code together. Use it to build stripes, dots, grids, rings, and other patterns without image files.

Adjust colors, size, thickness, angle, and opacity, and the preview and code update as you go.

How to Use

  1. Choose a pattern.
  2. Set the background and pattern colors.
  3. Adjust the pattern size, thickness, and angle.
  4. Choose an output format, then copy the generated code.

Available Patterns

Seventeen patterns are available, including lines, dots, grids, and decorative motifs. You can switch patterns while keeping the same colors and settings to compare how they look.

Main Settings

Colors

Set the background color and the pattern color. Colors can be entered as hex, rgb(), or oklch().

Lower the pattern opacity to make the pattern blend into the background.

Pattern Size and Thickness

Pattern size controls how often the pattern repeats. Thickness changes the size of the pattern itself, such as line width or dot radius. The thickness setting appears only for patterns that use lines or dots.

Angle

This setting is available for stripes and crosshatch. Use it to change the direction of the pattern.

Overlay

You can add a bottom fade, spotlight, or vignette over the background. A higher overlay strength makes the effect stronger.

Output Formats

  • CSS: declarations such as background-color and background-image. Paste them directly into a stylesheet.
  • Tailwind: the same result as Tailwind v4 utility classes.
  • @utility: a Tailwind v4 @utility definition. Paste it into a stylesheet and use it as a class such as pattern-stripes.

Use Cases

  • Decorating hero sections or content blocks without image files.
  • Adding a subtle pattern behind cards or banners.
  • Preparing reusable background patterns as Tailwind utilities for a design system.
  • Comparing the same pattern in different colors while deciding on a page's look.

Things to Keep in Mind

  • The generated output is background CSS only and does not include layout or spacing styles.