CSS Gradient Generator

Build a linear, radial or conic gradient with up to eight color stops, preview it and copy the CSS.

Inputs stay on your device No sign-up Free to use
How this works

The tool runs in this browser. Your file or text is not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Privacy details

Generate CSS controls

Used by linear and conic gradients.

Optional. One stop per line as #hex position, such as #2f8f6f 50%. Up to eight stops in total, counting the two above, and the positions must increase from the first stop to the last.

Processed in your browser. Your inputs stay on this device.

Showing a generated example. Generate again for a new result.

How to use CSS Gradient Generator

  1. Choose linear, radial or conic, then set the angle for the types that use one.
  2. Pick the start and end colors and positions. For more colors, enter intermediate stops as #hex position%, one per line.
  3. Check the live preview, then copy the CSS rule into your stylesheet.

Example: CSS Gradient Generator

Build a linear gradient between two greens.

You add
Type: linear. Angle: 90 degrees. First color: #154c3f at 0%. Second color: #55d6ab at 100%.
You get
The rule is .gradient { background-color: #154c3f; background-image: linear-gradient(90deg, #154c3f 0%, #55d6ab 100%); } and the preview shows the same fade.

Options

Gradient type
Linear runs in one direction from the angle. Radial spreads from the center in a circle. Conic sweeps around the center and starts at the angle you set.
Color stops
The first two controls set the endpoints. Extra color stops add up to six intermediate colors with their own positions, in increasing order.
Background color fallback
The rule sets background-color to the first color before the gradient, so a browser that cannot draw gradients still shows a solid color.

Supported inputs and limits

Two to eight hex color stops are supported. Extra stops sit between the two endpoint controls, in increasing order. Positions must be distinct and run from 0% to 100%; angles run from 0 to 360 degrees. Extra stop text is limited to 2,048 characters. Preview and copied CSS use the same validated values. This writes one background-image rule and a solid fallback; it does not edit an existing stylesheet or check color contrast.

Where your input is processed

This tool processes your input in this browser. Your text and files are not uploaded to UseFreeTools. Check this tool's limits for anything it may save on your device.

Angles and the painted box

A linear angle is measured clockwise from the bottom of the box: 0 degrees points up, 90 degrees points right and 180 degrees points down. The angle applies to the element the gradient paints, so the same rule looks different on a wide button and a tall panel. Copy the rule and check it on the real element at the size it will appear.

Questions about CSS Gradient Generator

Can I use the generated CSS in any browser?

Linear and radial gradients work in current browsers. Conic gradients also work in current browsers, but older versions ignore them, which is why the rule sets a solid background-color first.

Why does the preview look different from my page?

The preview uses a fixed box on a plain background. Your element may have a different size, border radius or background behind it, and those change how the same gradient reads.

How do I add more than two colors?

Keep the endpoint colors in their controls. Add intermediate colors in Extra color stops, such as #ff0000 50%. Use one line per stop, with positions strictly between the endpoints and increasing from line to line. The total limit is eight colors.

Does the page change my site or store the colors?

No. The gradient is built in this browser, and nothing is saved or sent anywhere.

Project manager: Tony Hines · Content updated 30 September 2026 · Report a problem