CSS Gradient Generator
Design linear, radial and conic CSS gradients with any number of colour stops, preview them live and copy the CSS.
Runs in your browser. Nothing is uploaded.
How to use the CSS Gradient Generator
- Choose a gradient type, linear, radial or conic, or start from a preset.
- Set the angle for linear and conic gradients, or the shape and centre for radial ones.
- Edit the colour stops. Change colours, set positions in percent (leave empty to space them evenly), add or remove stops.
- Tick Smoother blend (OKLCH) for brighter transitions between very different colours.
- Copy the CSS. It includes a solid colour fallback.
Design gradients visually
CSS gradients replace background images for many designs: hero sections, buttons, cards, progress bars and decorative shapes. They load instantly, scale to any size and are easy to change. Writing them by hand, though, means guessing angles and stop positions and reloading to see the result. This generator lets you build the gradient with controls and a large live preview, then copy finished CSS.
Three kinds of gradient
- Linear gradients blend along a line. Set the angle: 0 degrees goes upward, 90 to the right, 180 downward.
- Radial gradients spread from a centre point, as a circle or an ellipse that follows the shape of the element. Move the centre to create a spotlight or a glow.
- Conic gradients sweep around a centre, starting at the angle you choose. They are ideal for pie charts, colour wheels and loading spinners.
Colour stops
Each stop has a colour and an optional position in percent. Leave the position empty and the browser spaces stops evenly. Add as many stops as you like for multi-colour blends, and place two stops at the same position for a sharp line. Repeat the pattern turns the stops into stripes or rings that repeat across the element.
Better blends with OKLCH
Gradients between distant colours often pass through a muddy grey in the middle, because browsers mix
colours in sRGB by default. Tick the OKLCH option to add in oklch to the CSS, so the transition stays
bright and even. Current browsers support it, and the generator previews the effect live.
Ready-to-use CSS
The output includes a solid fallback colour followed by the gradient, so it works everywhere. Start from a preset, Sunset, Ocean, Aurora, Spotlight or Colour wheel, and adjust from there. Everything runs in your browser. Pair it with the Box Shadow Generator and Border Radius Generator to style complete cards and buttons.
Frequently asked questions
What is the difference between linear, radial and conic gradients?
A linear gradient changes colour along a straight line at an angle. A radial gradient spreads out from a centre point in a circle or ellipse. A conic gradient turns around a centre point like the hands of a clock, useful for pie charts and colour wheels.
What does the OKLCH option do?
By default browsers mix colours in sRGB, which can make the middle of a gradient look grey or dull, for example between blue and yellow. Mixing in OKLCH keeps colours bright through the transition. It works in current browsers; older ones show the normal blend.
Why is there a solid background line first?
It is a fallback. Very old browsers, and some email clients, ignore gradients and use the solid colour instead of showing nothing.
How do I make stripes?
Put two stops at the same position to get a hard edge, for example red at 50% and blue at 50%. Tick Repeat the pattern to repeat the stops across the element.
Is anything uploaded?
No. The gradient is built and previewed in your browser.
Tutorials
How to make a gradient without the grey middle
See why a blue-to-yellow CSS gradient turns grey in the middle, fix it with OKLCH interpolation, and add a fallback for older browsers.