CSS Gradient Generator
Builds CSS gradient code from a list of colour stops. It supports linear, radial, conic and repeating linear gradients, shows a live preview and prints a Tailwind version as well.
Use the tool
Why this tool exists
Gradients are quick to write when you remember the syntax and annoying when you do not: the angle, the position keywords, where the stops sit, and whether it is conic or radial. A typo makes the whole declaration invalid and the browser shows nothing.
Type your stops one per line, each with an optional position such as a percentage, choose the gradient type and angle, and the tool writes the background declaration and previews it full size. Colours are checked, so a bad value gives an error instead of broken CSS. For linear gradients on the eight standard angles with up to three plain colours it also prints the Tailwind direction classes. It runs in your browser and nothing is uploaded.
How to use it
- Enter the colour stops, one per line, with optional positions.
- Choose a type: linear, radial, conic or repeating-linear.
- Set the angle, the radial shape and the centre position if needed.
- Copy the CSS background or the Tailwind classes.
Frequently asked questions
How do I set where a colour stops?
Add a position after the colour on the same line, such as "#ff512f 0%" or "red 30px". Without a position the browser spreads the stops evenly.
Which angle applies to which type?
Linear and repeating gradients use the angle as written. Conic gradients use it as the starting angle. Radial gradients ignore it and use the shape and centre position instead.
What Tailwind output do I get?
Always an arbitrary-value background class. For a linear gradient at one of the eight standard angles with at most three simple stops you also get the from, via and to classes.
Why do I get an error?
You need at least two stops, and each colour must be a valid CSS colour. Check for a missing comma inside rgb functions and for a position without a colour.