Home  /  Developer Tools / CSS Gradient

CSS Gradient Generator

Build a linear, radial, or conic gradient with a live preview, then copy the exact CSS or download it as a PNG.

Last updated 13 November 2026

CSS Gradient Generator Tool

135 degrees

Presets:

The CSS shown is exactly the CSS for the preview above. Paste the background rule into your stylesheet. The PNG download renders the same gradient as an image.

A CSS gradient is a smooth blend between two or more colours, painted by the browser from code instead of loaded as an image file. It is used for hero banners, buttons, cards, and backgrounds, and it stays sharp at any screen size because there is no image to stretch.

How to Use This Tool

  1. Pick a gradient type: linear for a straight blend, radial for a glow from the centre, or conic for a blend around a point.
  2. Choose your colours: pick two colours, or add a third colour stop for a richer blend.
  3. Set the angle: rotate a linear or conic gradient until the preview looks right.
  4. Copy the CSS: paste the background rule into your stylesheet, or download the gradient as a PNG image.

Sample CSS

A linear gradient at 135 degrees from purple to light lavender looks like this in CSS: background: linear-gradient(135deg, #5C27FE 0%, #DEC7FF 100%); The tool writes this code for you, with your own colours, stops, and angle, so you never have to guess the syntax.

Why Use This Tool

Writing gradients by hand means guessing angles and stop positions, saving, refreshing, and repeating. This generator removes that cycle: every change redraws the preview at once, and the code below the preview is always the exact code for what you see.

What Each Gradient Angle Means

The angle sets the direction a linear gradient runs in. It is measured in degrees, clockwise from the top. An angle of 0 degrees runs from the bottom to the top, so the first colour sits at the bottom and the last colour sits at the top. An angle of 90 degrees runs from the left to the right, which is the most common choice for a wide banner. An angle of 180 degrees runs from the top to the bottom, and 270 degrees runs from the right to the left.

The tool opens at 135 degrees, which runs from the top left to the bottom right. That diagonal suits most hero backgrounds because it gives the eye a direction to follow. The same angle also sets where a conic gradient starts its sweep around the centre. A radial gradient has no direction, so the angle slider does nothing while radial is selected, even though it stays visible on the page.

AngleDirection the blend runsGood for
0 degreesBottom to topA colour rising from the base of a card
90 degreesLeft to rightWide banners and buttons
135 degreesTop left to bottom rightHero backgrounds, the tool default
180 degreesTop to bottomA colour fading down a page section
270 degreesRight to leftA mirror of the 90 degree blend

Linear Radial and Conic Compared

The three gradient types paint the same colours in very different shapes. A linear gradient blends in a straight line, so it suits banners, buttons and page backgrounds. A radial gradient spreads out from the centre in a circle, so it suits a glow or a spotlight behind a heading. A conic gradient sweeps around a point like the hand of a clock, so it suits colour wheels and pie chart effects.

TypeShapeAngle does whatBest for
LinearStraight blendSets the directionBanners, buttons, backgrounds
RadialCircle from the centreNothing, the blend has no directionGlow and spotlight effects
ConicSweep around a pointSets where the sweep startsColour wheels and pie charts

On this page a radial gradient is always a circle in the centre, with no shape, size or position control, and a conic gradient always starts from the centre, with no centre control. Those controls do not exist yet, so the copy here does not pretend they do.

Ready to Use Gradient Recipes

The tool has four presets. Click one to load its colours into the tool, then copy the CSS or change the angle to suit your page. Each preset keeps the gradient type and angle you already have selected, so pick the type first if you want a radial or conic version of a preset.

PresetColoursCSS at 135 degrees
Sunset#ff7e5f to #feb47blinear-gradient(135deg, #ff7e5f 0%, #feb47b 100%)
Ocean#2193b0 to #6dd5edlinear-gradient(135deg, #2193b0 0%, #6dd5ed 100%)
Purple Dream#5C27FE to #DEC7FFlinear-gradient(135deg, #5C27FE 0%, #DEC7FF 100%)
Forest#11998e to #38ef7dlinear-gradient(135deg, #11998e 0%, #38ef7d 100%)

Sunset suits a warm call to action, Ocean suits a calm product page, Purple Dream is the tool default and suits a brand header, and Forest suits a fresh outdoor theme. If you need a colour that is not in these four, pick it with the Color Picker on this site and type its code into a colour field here.

How to Use a Gradient in Your Stylesheet

Copy the CSS from the code box and paste it as a background rule in your stylesheet, for example on a hero section, a button or a card. The rule the tool shows is the full background value, so write it as background: linear-gradient(135deg, #5C27FE 0%, #DEC7FF 100%); inside your own rule.

Set a plain background colour first, before the gradient rule, so that a very old browser that ignores the gradient still shows a colour instead of nothing. This matters most for conic gradients, which a very old browser ignores entirely. A linear or radial gradient on the same old browser is ignored in the same way, so the fallback colour is worth setting for every type.

If you need the gradient as an image, use the Download PNG button. The PNG is 1200 by 800 pixels and renders the same gradient, in the same direction and with the same colours, as the preview and the CSS. It suits a slide deck or a social post where CSS cannot be used.

What This Generator Cannot Do Yet

This generator takes at most three colour stops: Colour 1 and Colour 2, plus an optional Colour 3. There is no button to add a fourth stop, and no way to reorder stops beyond their position numbers. It has four presets only, and no Tailwind, SCSS or SVG export, so the only outputs are the CSS rule and the PNG image.

There is also no transparency control, so every stop is a solid hex colour, and no share link, so a gradient cannot be saved or sent as a web address. Gradient text, animated gradients and repeating gradients are not part of this tool either. Until those features are built, this page states the limits plainly instead of promising them.

Frequently Asked Questions

Yes. It is free, needs no sign up, and runs in your browser.

Linear, radial, and conic gradients, with two colours or an optional third colour stop.

Yes. The PNG download renders the same gradient at 1200 by 800 pixels. Conic PNG export needs a browser that supports conic canvas gradients.

The CSS shown works in all modern browsers. A very old browser that does not understand conic gradients ignores the rule and shows nothing, so set a plain background colour first if you must support them.

No. All colour and angle values stay in your browser. Nothing is sent to a server.

Yes. Colour pickers, angle slider, and copy button all work in a modern mobile browser.

Three at most. Colour 1 and Colour 2 are always used, and you can add Colour 3 with the Use third colour checkbox. There is no button to add a fourth stop yet.

The angle sets the direction of a linear or conic gradient. 0 degrees runs bottom to top, 90 degrees runs left to right, 180 degrees runs top to bottom and 270 degrees runs right to left. The angle has no effect on a radial gradient, which always spreads from the centre.

This generator does not have a gradient text mode, so it cannot output gradient text for you. In your own stylesheet you can put a gradient on the background of the text, clip that background to the text, and make the text colour transparent. That is a manual step, not something this tool does.

Yes. The gradients are built from colours you pick, and the tool is free to use for personal and commercial projects. The CSS and the PNG are yours to use once you generate them.

1200 by 800 pixels. The PNG renders the same gradient, in the same direction and with the same colours, as the preview and the CSS shown on the page.