← All Tools

CSS Gradient Generator🔒 100% local

Generate CSS linear/radial gradients from hex colors with live preview and copy-ready code. Privacy-first, runs in your browser.

Related Tools

Color BlenderGradient GeneratorColor Contrast

Type a gradient kind and two or more hex colors, and the page writes the CSS declaration plus four variants of the same ramp. The first comma-separated token decides the kind (anything starting with rad becomes radial, everything else becomes linear), and the remaining tokens are filtered down to valid #rgb or #rrggbb values before being spaced evenly from 0% to 100%. The color list you type is parsed and formatted inside the page, never posted anywhere.

How to use it

  1. Type the kind first, then the colors: linear, #FF0000, #0000FF - or radial, #FFF, #000.
  2. Press Generate. A preview strip above the output repaints from the main declaration so you can judge the ramp on screen.
  3. Use Copy Output for the whole block: main rule, vertical, diagonal, radial and conic variants, and an SCSS line.

Worked example

linear, #FF0000, #0000FFbecomesType: linear Colors: #FF0000 → #0000FF CSS: background: linear-gradient(90deg, #FF0000 0%, #0000FF 100%); Variants: /* vertical */ background: linear-gradient(180deg, #FF0000 0%, #0000FF 100%); /* diagonal */ background: linear-gradient(135deg, #FF0000 0%, #0000FF 100%); /* radial */ background: radial-gradient(circle, #FF0000 0%, #0000FF 100%); /* conic */ background: conic-gradient(from 0deg, #FF0000 0%, #0000FF 100%); SCSS mixin: @mixin gradient { background: linear-gradient(90deg, #FF0000 0%, #0000FF 100%); }

Stops are computed rather than typed: two colors land at 0% and 100%.

linear, #00C6FF, #0072FF, #7C4DFFbecomesType: linear Colors: #00C6FF → #0072FF → #7C4DFF CSS: background: linear-gradient(90deg, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); Variants: /* vertical */ background: linear-gradient(180deg, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); /* diagonal */ background: linear-gradient(135deg, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); /* radial */ background: radial-gradient(circle, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); /* conic */ background: conic-gradient(from 0deg, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); SCSS mixin: @mixin gradient { background: linear-gradient(90deg, #00C6FF 0%, #0072FF 50%, #7C4DFF 100%); }

Three colors are spaced at 0%, 50% and 100%.

When to use it

What it does not do