X
🎨

CSS Gradient Generator

Design linear, radial & conic gradients with a live preview — unlimited colour stops, any angle — then copy the CSS.

135°
background: …;
Advertisement

Design beautiful CSS gradients and copy the exact code

A gradient is a smooth blend between two or more colours, and it is one of the quickest ways to give a flat page some depth and personality. The hard part has always been writing the syntax by hand — remembering the angle order, the percentage positions and the function name, then reloading the page over and over to see what changed. This CSS gradient generator removes all of that guesswork. You build the gradient visually in the live preview at the top of the page, and the tool writes valid, ready-to-paste CSS for you underneath as you work.

It is built for front-end developers, designers, students and hobbyists who want a good-looking background without trial and error. There is nothing to install and nothing to learn first: every control updates the preview the moment you touch it, so you always see the real result instead of imagining it. When the blend looks right, one click copies the full background declaration to your clipboard. Everything happens inside your browser — no account, no upload, no limits.

How to use the gradient generator

  1. Choose a gradient type — Linear, Radial or Conic — using the buttons under the preview.
  2. Drag the angle slider (for linear and conic gradients) to set the direction the colours travel.
  3. Edit each colour stop: tap the colour swatch to recolour it and drag the position slider from 0% to 100% to control where that colour sits.
  4. Use Add colour to insert more stops (up to eight), the to remove one, or Random to roll a fresh palette.
  5. Pick a ready-made preset to start from, then tweak it to taste.
  6. Click Copy CSS and paste the code into your stylesheet.

Linear, radial and conic — when to use each

A linear gradient blends colours along a straight line, and the angle sets that line's direction: 0° runs bottom to top, 90° runs left to right, and 135° gives the popular diagonal look. It is the default choice for page backgrounds, hero banners, buttons and cards. A radial gradient (this tool outputs radial-gradient(circle, …)) spreads outward from a centre point, which is ideal for soft spotlight glows, badges and round buttons; because it has no direction, the angle control is hidden when you select it. A conic gradient sweeps the colours around a centre point like the hand of a clock, and its start angle decides where the sweep begins — perfect for pie-chart segments, colour wheels and loading spinners.

Colour stops, positions and smooth blends

Each colour stop is a colour plus a position written as a percentage, for example #8b5cf6 0%. The browser fills the space between two stops with a smooth transition, so the gap between positions controls how gentle or abrupt the blend is. Place two stops far apart for a soft fade; move them close together for a sharp line, which is how you create stripes or hard colour bands. Adding a stop in the middle gives a three-colour blend, and you can keep going up to eight stops for rich, multi-tone effects. The tool always sorts your stops by position before writing the code, so the output stays valid even if you drag them out of order.

Tips, common mistakes and accessibility

Keep most backgrounds to two or three stops — too many colours quickly look muddy rather than vibrant. If you are placing text over a gradient, check that the words stay readable against the lightest and the darkest part of the blend, not just the middle, and add a subtle dark overlay if contrast is tight. A frequent mistake is reaching for a radial gradient and then expecting the angle to do something; remember that radial gradients have no direction. Another is forgetting that linear-gradient is an image value, so it belongs on background or background-image, not on the plain background-color property. For wide browser support you can drop the generated value straight in — linear, radial and conic gradients are supported across all current major browsers.

Private and free, right in your browser

Nothing you create here is sent anywhere. The preview, the colour maths and the generated code all run locally on your device using standard browser features, so your palettes never leave your computer and the tool keeps working even if your connection drops. There is no sign-up, no watermark and no cap on how many gradients you can make — experiment as much as you like, copy what you need, and move on.

FAQ

How do I use a CSS gradient in my site?

Copy the generated code and paste it into your CSS, for example: background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%); A gradient is an image value, so put it on the background or background-image property of any element — a section, button, card or the whole page.

What is the difference between linear, radial and conic gradients?

A linear gradient blends colours along a straight line at the angle you choose. A radial gradient blends outward from a centre point in a circle, which is why this tool writes radial-gradient(circle, …). A conic gradient sweeps the colours around a centre point like a colour wheel, starting from the angle you set.

Can I add more than two colours?

Yes. Click Add colour to insert extra colour stops — up to eight in total — then drag each stop's position slider from 0% to 100% to control exactly where it sits. The tool sorts the stops automatically, so the code stays valid however you arrange them.

Why does the angle slider disappear for radial gradients?

Radial gradients spread evenly outward from a centre point and have no direction, so an angle would do nothing. The tool hides the angle control whenever you select Radial, and shows it again for Linear and Conic gradients, where it sets the direction or the start of the sweep.

How do I make sharp stripes instead of a soft fade?

Move two colour stops very close together — for example one colour at 50% and the next at 51%. The smaller the gap between positions, the harder the edge between the colours, which lets you build crisp stripes or solid colour bands. For a gentle blend, spread the stops further apart.

Is it free and private?

Yes. The gradient generator is completely free with no sign-up, no watermark and no limits. Everything — the preview, the colour maths and the generated code — runs locally in your browser, so nothing is uploaded and your palettes never leave your device.

More tools