Skip to content
All tools
English

CSS gradient generator

Pick a type, set the colours and positions, and copy CSS that works in every browser.

Runs in your browser, nothing is uploaded
Start from
Type
90°
50%
50%
Colour stops

    How to use it

    1. Choose the type

      Linear runs in one direction, radial spreads from a point, conic sweeps around it.

    2. Edit the colour stops

      Add up to eight colours and set where each one sits, from 0% to 100%.

    3. Copy the CSS

      The code includes a solid colour and an sRGB fallback for older browsers.

    Why gradients turn grey in the middle

    By default browsers blend gradient colours in sRGB. Between two saturated colours on opposite sides of the colour wheel, such as blue and yellow, the halfway point in sRGB is a dull grey. Choosing OKLCH or OKLab interpolation keeps the middle bright: OKLCH travels around the hue wheel, OKLab goes straight across but keeps the lightness even.

    The in oklch syntax works in current Chrome, Edge, Safari and Firefox. Older browsers ignore that line, so the generated code puts an ordinary sRGB gradient first as a fallback, and a solid colour before that.

    The three gradient types

    • linear-gradient: colours change along a straight line. 0deg goes up, 90deg goes right, 180deg goes down.
    • radial-gradient: colours spread out from a centre point as a circle or an ellipse that fits the box.
    • conic-gradient: colours sweep around a centre point, like a pie chart or a colour wheel.

    Turn on repeat and set the last stop below 100% to get stripes, rings or sunbursts.

    Text on a gradient

    If you place text on top, check it against both the lightest and the darkest stop with the contrast checker. Need a colour in another format first? Use the colour converter.

    Frequently asked questions

    How do I make a gradient background cover the whole page?
    Put the CSS on body or html and add min-height: 100vh. A gradient is an image, so without a height the body may be shorter than the window and the gradient repeats.
    Can I use transparent colours?
    Yes. Type rgba() or 8-digit HEX into a stop. Fading to a transparent version of the same colour looks cleaner than fading to the keyword transparent.
    How do I put a gradient on text?
    Use the gradient as the background, then add background-clip: text and color: transparent. Keep a solid color as a fallback for readability.
    Does it cost anything or add a watermark?
    No. The tool is free, works in your browser and the CSS is yours to use anywhere.