Back to public tools
All tools

CSS Gradient Generator

Blend colors into a CSS gradient for a background or button. Move the colors, turn the gradient and copy the CSS when it looks right.

Choose a gradient type, then edit its stops. Valid settings update the preview and CSS automatically. Preview background and sample text are separate from the exported gradient.

Color stops · two to eight

Positions control color order. Equal positions create hard transitions; earlier/later changes their tie order. Repeating gradients repeat the span between the first and last positions.

Gradient presets

Import one gradient value or background-image declaration: literal hex/RGB/HSL/basic named colors, percentage stops, numeric angles, percentage centers and named radial extents. No URLs, variables, multiple backgrounds, hints or custom radial radii.

Sample text
Image export and contrast sampling

Images contain only your generated gradient, without the sample text or animation. SVG uses self-contained CSS and foreignObject; some image viewers do not support it. PNG is a fixed-size raster from this browser.

Sampling uses the current browser, image size, text color and opaque preview backdrop. Narrow bands can fall between samples. This does not prove every pixel or text position meets WCAG; check your final layout and text size.

Animated gradient CSS

Animation moves an enlarged background, rather than morphing stops. Preview is off by default. Export and preview respect reduced-motion preferences.

Design-token export

DTCG 2025.10 stops include sRGB colors, opacity and normalized positions. Geometry, repeating and interpolation are retained in a ToolTulip extension; other design applications may ignore those extra settings.

Everything stays in browser memory. CSS import is restricted to supported literal gradients; it never executes CSS or fetches resources. Nothing is saved automatically.

How to use the CSS gradient generator

Select a numbered stop to edit its hex color, opacity and position. Add stop creates another color between existing stops; Delete stop removes the selected stop. Use two to eight stops.

Choose Linear, Radial or Conic. Radial gradients offer circle/ellipse shapes, named extents and a percentage center; conic gradients rotate around their center. Turn on Repeating to repeat the distance between the first and last stops. Choose sRGB or OKLCH with shorter-hue interpolation; unsupported browsers show a warning.

Change the angle to turn the gradient: 0° points up, 90° right, 180° down and 270° left. The preview and complete CSS update automatically when all fields are valid.

Stops follow their positions. Equal positions make a sharp transition; Move earlier and Move later change the order of tied stops. Lower opacity lets the background show through.

Use the preview background to see transparency on a solid color. This background and the checkerboard are not exported. Copy CSS or download gradient.css to use the generated .gradient class. Reset restores the default gradient; Undo and Redo restore up to twenty gradient edits. Preview background, image and export settings are separate.

Paste one supported literal CSS gradient and choose Import gradient, or select a named preset. Colors normalize to 8-bit RGB; omitted positions are distributed and decreasing positions are clamped using CSS stop rules. Unsupported syntax leaves your current gradient unchanged.

Set image dimensions from 1 to 2048 pixels per side and download PNG or SVG. Include the preview backdrop only when you want it in the image. SVG uses CSS foreignObject, which some viewers cannot display. Sample contrast checks a 33 × 33 grid over the opaque preview backdrop; narrow bands can be missed, so check the final text placement.

Animation CSS moves an enlarged background and includes a reduced-motion override. Animation preview starts off. Design-token JSON exports DTCG color stops, with geometry and interpolation in a ToolTulip extension.

Example: a warm banner background

Choose Try an example for a pink-to-orange gradient at 135°. Select Stop 2 and lower its opacity to let more of your page background show through. Copy the CSS and apply the gradient class to a banner.

About CSS gradients

A linear gradient blends colors along a straight line, a radial gradient expands from a center, and a conic gradient turns around it. It can give a website banner, button or card a colorful background without an image file.

The CSS includes a first-stop fallback color underneath the gradient image. Both layers are shown in the preview; translucent fallbacks can still reveal your page background. Transparent colors blend with whatever is behind the element, so try the gradient on your intended page background.

Stars and feedback

Loading…

Tool reference #122