Hoglet

CSS gradient generator

Type or paste a gradient here to edit it.

Try

Linear gradient · 2 stops

CSS Gradient Generator: Linear, Radial, Conic, OKLCH

Build a linear, radial or conic gradient and copy its CSS.

A gradient is a background that blends from one colour to the next. Choose linear (along a line, at an angle), radial (out from a centre) or conic (round a centre, like a colour wheel), then shape it with its stops: press the bar under the preview to add a stop there, drag a stop to move it, or choose one and type its colour (any CSS colour) and its place in percent. The arrow keys move the chosen stop, Delete removes it, R reverses them all and Space makes a random one. The CSS under it is what you copy; you can also type in it, or paste a gradient from a stylesheet anywhere in the window, and it is read back into stops (stops in percent; lengths in px are not read). Browsers mix the colours between stops in sRGB unless told otherwise, which can turn the middle of blue to yellow a dull grey; Options can mix them in OKLab or OKLCH instead, and then a plain line is written first for older browsers, which skip the line they don’t understand. Options also make it repeat and place the centre of a radial or conic one. Nothing leaves this device.

How to use CSS gradient generator

  1. Choose Linear, Radial or Conic, or start from one of the gradients under Try.
  2. Press the bar to add a stop, drag a stop to move it, and type each stop’s Colour and Place.
  3. Press Copy CSS to copy the gradient for your stylesheet.

CSS gradient generator: common questions

Does the CSS gradient generator upload anything?

No. The CSS gradient generator builds the gradient and its CSS in your browser, on your device; nothing leaves it, including gradients pasted from your stylesheets.

Why does the middle of my CSS gradient look grey?

Browsers mix gradient colours in sRGB unless told otherwise, which can turn the middle of blue to yellow a dull grey. The CSS gradient generator can mix in OKLab or OKLCH instead, and then writes a plain line first for older browsers.

Can I paste an existing CSS gradient to edit it?

Yes. Paste a gradient from a stylesheet anywhere in the window, or type it into the CSS, and the gradient generator reads it back into stops. Stops must be placed in percent; lengths in px are not read.

Everything stays on your device. Nothing is uploaded. Works offline once your first visit has stored the app.