CSS Gradient Generator

Design linear, radial and conic gradients and copy the CSS.

Loading tool…
Free, no sign up. Runs in your browser, so your data never leaves your device.

What is a CSS gradient generator?

A CSS gradient is a smooth blend between two or more colours that the browser draws for you, with no image file to download. Gradients are popular for hero sections, buttons, cards and backgrounds because they add depth while staying sharp at any screen size. Writing the code by hand means juggling angles, colour codes and percentages. This generator lets you design the gradient visually and copy ready to use CSS.

How to make a gradient

  1. Choose the gradient type: linear, radial or conic.
  2. Set the angle for linear and conic gradients, or the shape and position for radial ones.
  3. Pick a colour for each stop and drag its position slider. Press Add colour stop for more colours, or Remove to delete one.
  4. Watch the large preview update as you work.
  5. Press Copy CSS and paste the code into your stylesheet or page builder.

Options

  • Linear gradients blend colours along a straight line at any angle from 0 to 360 degrees.
  • Radial gradients spread out from a point as a circle or ellipse, placed in the centre, a side or a corner.
  • Conic gradients sweep around a centre point, useful for pie chart effects and colour wheels.
  • Up to 10 colour stops, each with its own position from 0 to 100 percent.
  • Repeating mode for stripes and patterns.
  • Reverse and Random buttons to flip the direction or explore new ideas.

Where to use the code

The output includes a solid background colour first, followed by the gradient. Very old browsers that do not understand gradients use the solid colour instead. In Elementor and other page builders you can paste the line into a custom CSS box for a section or widget. In plain CSS, use it on any selector, such as a header, a button or the body.

Tips for good gradients

Subtle gradients between two related colours usually look more professional than rainbow blends. Try colours that sit next to each other on the colour wheel, or two shades of the same hue. If text sits on top of a gradient, check that it is readable against both the lightest and the darkest part. Placing two stops at the same position creates a hard edge, which is a simple way to make stripes.

Gradients and performance

Because a gradient is drawn by the browser, it adds only a line of text to your stylesheet instead of an image download. That keeps pages light and fast, which visitors and search engines both appreciate. It also means you can change a colour later by editing the code, with no need to export a new image.

Frequently asked questions

Do CSS gradients work in all browsers?

Linear and radial gradients work in every modern browser. Conic gradients work in current versions of Chrome, Edge, Firefox and Safari. The code also includes a solid fallback colour.

How many colours can I use?

You can use between 2 and 10 colour stops, each with its own position.

Can I use the gradient as an image?

The tool produces CSS code rather than an image file. CSS gradients load instantly and stay sharp at every size, so they are usually the better choice on websites.