Skip to content
AZ Tools

CSS Gradient Generator

Build linear or radial CSS gradients with multi-stop colors and copy the code.

Type

Color stops

  • 0%
  • 100%
Preview
CSS
background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
Tailwind
bg-[linear-gradient(135deg,_#3b82f6_0%,_#8b5cf6_100%)]

How to use

  1. Pick linear or radial.
  2. Adjust the angle (linear) or shape (radial).
  3. Edit the color stops and drag the position sliders.
  4. Copy the CSS rule or the Tailwind class.

About this tool

Show

Design linear or radial CSS gradients visually: pick the type, set the angle or shape, add as many colour stops as you like, drag their positions, and watch a live preview update as you go. Stops are sorted by position before the rule is written, so you can add them in any order and still get valid CSS. Linear gradients use the CSS angle convention, where 0deg points up and the angle turns clockwise — not the mathematical one — and radial gradients can be a circle or an ellipse. Copy the result as a plain CSS rule, or as a Tailwind arbitrary-value class in which the spaces are replaced by underscores so the class name survives the parser.

Frequently asked questions

Why Tailwind arbitrary values?

Tailwind's bg-[…] arbitrary value class lets you drop a custom CSS gradient straight into a Tailwind project without writing a separate CSS file.

How many color stops can I add?

As many as you want — three to five usually looks best, but the tool supports any number.

Can I save a gradient?

Your last design auto-saves to your browser's local storage and reloads next time you open the tool.

Why does the Tailwind class use underscores?

Tailwind treats whitespace as a class separator, so arbitrary values use underscores in place of spaces.

Does the order I add stops in matter?

No. Stops are sorted by position before the rule is written, so you can add one at 80% and then another at 20% and still get valid CSS. Position is what decides where a colour sits; the row order in the editor is only for your convenience.

Which way does 0deg point?

Up. CSS measures the angle from the direction the gradient runs towards, starting at the top and turning clockwise, so 90deg runs left to right. The mathematical convention starts at the right and turns anticlockwise instead, which is why a gradient copied from a design tool sometimes arrives rotated.

Guides on this topic

Related tools