CSS Gradient Generator
Build linear, radial and conic gradients with colour stops and angles — live preview and copy-ready background CSS.
A CSS gradient is not an image file — it is an image the browser generates on the fly from a recipe of colours and positions, which is why it stays perfectly sharp at any size and costs no download. The linear recipe reads linear-gradient(angle, colour position, colour position, …). The worked example: linear-gradient(90deg, #ff0000 0%, #0000ff 100%) blends pure red at the very left edge into pure blue at the very right edge. Angles follow a compass-like convention that trips people up: 0deg points up (the blend runs bottom to top), 90deg points right, 180deg is the default top-to-bottom, and keywords like “to right” are accepted in place of the angle. Each stop pins a colour to a position along the gradient line; between two stops the browser interpolates, so a stop at 0% and the next at 100% spread the blend across the whole element.
Everything runs in your browser; your values are never uploaded, stored or put into a link. The preview is painted with the exact declaration shown above.
Quick answers
How do I make a left-to-right gradient in CSS?
background: linear-gradient(90deg, #ff0000 0%, #0000ff 100%) — 90deg aims the blend to the right, with red pinned at the left edge (0%) and blue at the right edge (100%).
Add a middle stop, such as #22c55e 50%, to route the blend through a third colour instead of the straight red-to-blue path.
What angle makes a diagonal gradient?
45deg runs from the bottom-left corner toward the top-right. Use 135deg for the other diagonal (top-left to bottom-right). Corner-to-corner exactness on non-square boxes follows the “magic corner” rule built into CSS, so the blend still lands on the corners.
Keywords do the same job in plain words: linear-gradient(to top right, …) is the 45deg family without memorising numbers.
How to use
- Pick the gradient type: linear for a straight blend, radial for a blend radiating from a point, conic for colours swept around a centre.
- For linear and conic, set the angle; for radial, pick the shape and position of the centre. 90deg linear runs left to right.
- Set the start and end colours and their positions in percent, and optionally add a middle stop for a three-colour blend.
- Check the preview, then copy the generated background declaration into your stylesheet.
About this tool
Radial and conic gradients reuse the same stop list with different geometry. A radial gradient radiates outward from a centre point — radial-gradient(circle, #ffffff 0%, #000000 100%) is a white hotspot fading to black at the edges, the standard trick for vignettes and soft spotlights. A conic gradient sweeps its stops around the centre like the hands of a clock — conic-gradient(from 45deg, …) starts the sweep rotated 45 degrees — which is how pure-CSS pie charts, colour wheels and sunburst loaders are built. Two practical tips: place two stops at the same position (for example #ffffff 50%, #000000 50%) to get a hard edge instead of a blend, and beware the muddy middle — blending between complementary colours such as red and green passes through grey-brown, so route the blend through a middle stop you actually like.
Frequently asked questions
Which way does a 90deg linear gradient run?
Left to right: the angle names the direction the gradient progresses toward. 0deg goes upward (bottom colour first), 90deg goes right, 180deg goes down — the default when no angle is given — and 270deg goes left. Diagonal blends are simply in-between values such as 45deg.
How do I make a hard colour split instead of a blend?
Give two stops the same position: linear-gradient(90deg, #3b82f6 50%, #22c55e 50%) is solid blue for the left half and solid green for the right half, with no blend between them. The same trick builds stripes — repeat hard-stop pairs at regular positions.
What is the difference between radial and conic gradients?
Both start from a centre point. A radial gradient moves outward in expanding circles or ellipses, like ripples — good for glows and vignettes. A conic gradient rotates around the centre, like a pie being sliced — good for pie charts, colour wheels and progress rings.
Should I set a background-color under a gradient?
Yes, as a fallback and a safety net. Put a background-color (usually the average or the end colour) on the element first; if a very old browser cannot parse the gradient it still shows a sensible solid colour, and the solid colour also shows for the instant before the gradient paints.
First time embedding? Read the step-by-step guide →
More free tools
CSS Box Shadow Generator
Design box shadows visually — offsets, blur, spread, colour, opacity and inset — and copy the exact box-shadow CSS.
Color Converter (HEX ↔ RGB)
Convert HEX to RGB and back, with live preview.
Color Palette Generator
Random harmonious color palettes, one click.
CSS Border Radius Generator
Round corners visually — per-corner sliders, px or %, and separate vertical radii for elliptical corners and blob shapes.
UUID Generator
Generate random v4 UUIDs in bulk.
JSON Formatter & Validator
Format, minify and validate JSON in one click.