CSS Gradient Generator

Build CSS gradients with stop and angle sliders and reusable color examples.

On-device No sign-up Free to use

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 an example. Change the fields, then use generate css to update it.

Result

Showing an example.

Create a left-to-right green gradient with a solid first-color fallback.

Generated a linear gradient at 90 degrees from #154c3f at 0% to #55d6ab at 100%. Copy the CSS below.

Loading the tool. Your result will appear here.

https://usefreetools.net/css-gradient-generator · 20 November 2026

Was this helpful?

How to use CSS Gradient Generator

  1. Choose Linear, Radial or Conic. Set an angle for Linear or Conic, or choose an editable color example.
  2. Choose endpoint colors and positions. To add intermediate colors, enter #hex position% in Extra color stops, one per line, in increasing order between the endpoints.
  3. Inspect the preview, then select Generate CSS and copy the rule. Replace .gradient with your selector and check it on the actual box and behind any text.

Example: CSS Gradient Generator

Create a left-to-right green gradient with a solid first-color fallback.

You add
Gradient type: linear; First color: #154c3f; Second color: #55d6ab; Angle in degrees: 90; First stop (%): 0; Second stop (%): 100
You get
Generated a linear gradient at 90 degrees from #154c3f at 0% to #55d6ab at 100%. Copy the CSS below.

Options

Gradient type
Linear follows the chosen direction. Radial spreads as a circle from the center. Conic sweeps around the center from the selected starting angle.
Angles
For a linear gradient, 0° points up, 90° right and 180° down. Conic uses the angle as its starting position. Radial ignores the angle.
Color stops
Use two endpoint colors and up to six extra stops. All positions must increase strictly from the first to the last and stay between 0% and 100%. Equal-position hard stops are outside this tool’s input rules.
Solid fallback
The copied rule sets background-color to the first color before background-image. A browser that ignores the gradient can still show that 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.
More details

This writes one background-image rule and a solid fallback; it does not edit an existing stylesheet or check color contrast.

Sliders update the existing native preview.

Draggable stop handles, random gradients and Tailwind/image exports are not provided.

Where your input is processed

This tool does not upload your inputs. See the limits for anything saved on your device.

Check the gradient on the intended box

A linear gradient’s 0° direction points up and angles increase clockwise. The gradient paints within the element’s box, so one rule can look different on a wide button and a tall panel. Test the real size and any text over it. Color stops do not guarantee text contrast across the whole surface.

Questions about CSS Gradient Generator

Can I use the generated CSS in any browser?

Check the gradient type in the browser versions you support. The copied rule includes a solid first-color fallback if its background image is ignored, but the tool does not test your browsers or the readability of text placed over it.

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.

Page updated · Project managed by Tony Hines · Report a problem with CSS Gradient Generator