Every gradient tool offers the same first choice, and it quietly decides the whole result: linear or radial. Pick linear and your color travels in a straight line, like light through blinds. Pick radial and it blooms outward from a center point, like a lamp switched on in a dark room. Neither is better in general. Each is better at a shape of effect, and choosing well means knowing which shape you are trying to make.

This comparison walks through what each type actually does, gives decision rules by use case, and then builds the same two colors both ways in the free CSS Gradient Generator on Ovatly, so you can see the difference in the CSS itself.

Contents

  • Quick answer
  • What a linear gradient does
  • What a radial gradient does
  • Worked example: the same two colors, two declarations
  • Decision rules by use case
  • How to build both in the generator, step by step
  • Where conic gradients fit
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Use a linear gradient when the effect has a direction: page backgrounds that darken towards the footer, buttons with a sheen, banners and stripes. Use a radial gradient when the effect has a center: a glow behind a headline, a spotlight on a product, a vignette that darkens the corners. In the CSS Gradient Generator, both are made the same way: choose the type, set the angle for linear or the shape for radial, place up to six color stops, and copy the single background declaration.

What a linear gradient does

A linear gradient blends colors along a straight axis. You control the axis with an angle: 180deg points downward, so the first color sits at the top and the blend runs to the bottom; 90deg runs left to right; 0deg runs bottom to top. Angles in between give diagonals, which is why so many buttons and hero banners sit at 135deg.

Because the blend is directional, linear gradients read as movement or lighting from one side. They are the natural choice for large flat areas: a page background that shifts subtly from top to bottom, a header bar, a call-to-action button. Add a second stop at exactly the same position as the first and the blend becomes a hard edge, an instant color change used deliberately for stripes and sharp splits.

What a radial gradient does

A radial gradient blends colors outward from a center point, in a circular or elliptical shape. The first color sits at the center and the blend spreads to the edges. Nothing travels in a direction; instead, one spot is emphasized and everything else falls away from it.

That makes radial gradients the tool for effects with a focal point: a soft glow behind a headline, a spotlight pooling on a product photo, a vignette that leaves the middle bright and darkens the corners. Used carelessly they can look like a stain, because the eye goes straight to the center. Used deliberately, that pull is exactly the point.

Worked example: the same two colors, two declarations

Build one gradient from the generator's own example colors: #0ea5e9 at 0% and #2563eb at 100%. As a linear gradient at an angle of 135deg, the output is:

background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);

The lighter blue starts in one corner and the deeper blue takes over towards the opposite corner. The whole element feels like it is lit from the side.

Switch the type to radial, keep the same two stops, and the declaration becomes a radial one with the same colors: #0ea5e9 now sits at the center and #2563eb spreads to the edges. Same colors, same stops, completely different picture: a bright pool in the middle with the darker blue closing in around it, like a spotlight or a deepening vignette. Comparing the two declarations side by side is the fastest way to learn the difference, with everything else held constant.

Decision rules by use case

  • Page and section backgrounds: linear, usually vertical (180deg) or a shallow diagonal. The direction stays quiet and the content reads over it easily.
  • Buttons and badges: linear at a diagonal. The sheen implies a light source and gives flat UI a little depth.
  • Hero spotlights and glows: radial, centered behind the headline or product. The blend draws the eye to the middle on purpose.
  • Vignettes and photo overlays: radial, with the darker color at the edges, framing whatever sits in the center.
  • Stripes, splits and hard divisions: linear, with two stops placed at the same position to force a hard edge.
  • Charts, wheels and sunbursts: neither of these two; that is conic territory, covered next.

How to build both in the generator, step by step

  1. Open the CSS Gradient Generator and choose the gradient type: linear, radial or conic.
  2. For linear, set the angle. For radial, set the shape. The preview updates with every change, so judge the effect on screen, not from the numbers.
  3. Adjust each color stop's color and position. Add or remove stops as needed, up to six.
  4. Copy the background declaration from the output. Stops are sorted by position in the output even if you set them out of order, matching how CSS resolves them.
  5. To compare types, leave the stops untouched and switch only the type, then copy each declaration and look at them side by side.

Where conic gradients fit

The generator also builds conic gradients, which sweep colors around a center point rather than outward from it. That circular sweep is what pie charts, color wheels and sunburst effects are made of. Conic is rarely right for a background wash, but when the design itself is a circle divided into segments, neither linear nor radial can do the job.

Limitations and honest tradeoffs

Colors in the generator are emitted as hex values, and every stop is a solid color. A fade to transparent, where a gradient dissolves into whatever sits behind the element, is not something this generator's output expresses. If your design depends on that effect, you will need to adjust the declaration by hand after copying it.

The preview is a live CSS rendering, not an image file, so there is nothing to download as a picture. What you take away is the declaration itself, which is the more useful artifact anyway: it weighs nothing, scales to any element size, and can be edited later with a text change instead of a new export.

Common mistakes

  • Choosing radial for a large flat background. The center pulls the eye and the corners go dark, which fights the content unless a spotlight was the intention.
  • Using too many stops. Six are available, but most good gradients use two or three. Every extra stop is another band the eye has to cross.
  • Judging the gradient at preview size only. A blend that looks smooth on a small swatch can band or turn muddy across a full-width banner. Check it at the size it will ship.
  • Expecting a transparent fade from the output. The stops are solid hex; plan the design around that or finish the declaration by hand.
  • Forgetting the hard-edge trick. Two stops at the same position give a clean split, which is often what a "two-tone background" request actually needs.

FAQs

Which type is better for a full-page background? It depends on the effect. A linear gradient gives the page a directional wash, like light falling from the top. A radial gradient puts a pool of light or color in one place, which suits hero sections built around a central headline.

Can I fade a gradient to transparent with this generator? No. Color stops are emitted as solid hex values, and a transparent stop is not among them. If your design needs a fade into whatever sits behind the element, you will have to write that step by hand.

What does the angle mean in a linear gradient? It sets the direction the color travels. 180deg points downward, so the start color sits at the top. 90deg runs left to right, and 0deg runs bottom to top. Diagonal angles like 135deg are common for buttons and banners.

How many color stops can I use? Up to six. Each stop has its own color and position, stops can be added or removed, and the output sorts them by position even if you set them out of order.

Can I download the gradient as an image? No. The preview is a live CSS rendering, not an image file. What you take away is the background declaration itself, ready to paste into your stylesheet.

Conclusion

Linear moves color along a direction; radial spreads it from a center. Once that single distinction is clear, the choice in any given design usually makes itself, and the CSS Gradient Generator lets you test it in seconds by switching the type while the stops stay put. If your site checks are the theme of the day, our guide to why a favicon is not showing works through another declaration-level problem in the same spirit. More guides like these live in our Website and Webmaster Tools guides.

References