CSS Gradient Generator

Presets
Type
135°
Color stopsUp to 5 stops

Gradient preview

What is CSS Gradient Generator?

Choose linear or radial, then add up to five colour stops with individual positions. Six curated presets (sunset, ocean, aurora, mist, neon, glow) give you a starting point.

Copy a CSS background declaration for your webpage or export a 1200×1200 PNG. Both use the selected colours and stops; the square image and a rectangular preview can show different transition proportions.

Worked example: a quiet card background

Select the “Mist” preset. Its two stops run from #f8fafc at 0% to #cbd5e1 at 100%, at 180 degrees. In CSS, 0 degrees points upward, 90 degrees right and 180 degrees down. Move the second stop inward to finish the transition earlier, then compare it with the original preset.

Paste the generated background declaration into the selector for your card. Add spacing and a radius separately: the generator controls the background image, not the surrounding layout. Choose a text colour and check its contrast across the area where the text will sit.

Mist: a vertical background for a card
Sunset: three stops at 120 degrees
A card using the Mist preset
.card-surface {
  padding: 1.5rem;
  border-radius: 1rem;
  color: #1e293b;
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
}

Use a radial gradient for a centred highlight

Select “Glow” to change to a radial gradient. The centre is fixed at 50% 50%, and the circle reaches the farthest corner. The angle slider is disabled because a circular radial gradient has no linear direction.

The 60% orange stop controls how much room the yellow centre occupies before the red edge. You can adjust each stop position and keep between two and five stops. Stops at the same position can create a hard boundary instead of a smooth transition.

Background declaration from the Glow preset
background: radial-gradient(circle farthest-corner at 50% 50%, #fde68a 0%, #f97316 60%, #b91c1c 100%);

Choose CSS or PNG for the destination

Use CSS for a responsive webpage: the browser redraws the gradient to fit the element. Use the PNG when you need a fixed bitmap for another application. The download contains the gradient only, not the card text, padding or rounded corners shown in the code example.

The PNG is always 1200 × 1200 pixels. The preview is usually a wide rectangle, so diagonal and radial transitions can occupy different proportions in the square export. The export uses the same stops and angle with canvas rendering; aspect ratio, colour interpolation and display handling mean it is not a promise of identical pixels.

This editor supports opaque colour stops in linear and centred circular radial gradients. It does not generate conic or repeating gradients, alpha stops, off-centre radial positions or selectable colour spaces. Check the result in the final element size and browser.

Export choices
OutputSizeBest fit
CSSFits the elementResponsive backgrounds and components
PNG1200 × 1200 pixelsA fixed image for a design or presentation

Frequently asked questions

Does the PNG match the CSS exactly?

It uses the same stops and angle, but the PNG is a 1200×1200 square. A different element aspect ratio, rendering or colour handling can change the appearance; pixel-for-pixel identity is not guaranteed.

References and example checks

Examples checked against this tool: .