Gradient Generator — Free CSS Gradient Maker (Linear, Radial, Conic)
Build beautiful CSS gradients in seconds: linear, radial, conic and repeating gradients, with a live preview, 36 presets, smooth colour blending, contrast check and PNG download. Free, no login, nothing is uploaded.
Live preview
linear-gradient(135deg, #ff512f 0%, #dd2476 100%)
Gradient type
Repeating turns the current type into repeating-linear, repeating-radial or repeating-conic gradient - great for stripes, rings and pie charts. The preview and the copied CSS always match exactly.
Colour stops (2 to 8) - click the bar to add a stop
Click a stop to edit it. Drag a stop to move it. Use the Left / Right arrow keys to move the selected stop by 1%, Shift + arrow keys by 10%. Two stops at the same position make a hard stop (a sharp stripe edge) - that is allowed on purpose. The first and last stop do not have to be at 0% and 100%.
Edit selected stop
Opacity below 100% is never dropped: HEX output becomes 8-digit HEX, RGB output becomes rgba(), HSL output becomes hsla(). Named colours are not accepted - use a HEX, RGB or HSL value.
Linear angle
Click or drag the dial to set the angle.
135deg = top-left -> bottom-right
CSS angle rule: 0deg = up (to top), and the angle increases clockwise: 90deg = to right, 180deg = to bottom (the default), 270deg = to left. This is the opposite of school maths and canvas angles.
Smooth blending
Standard: the browser blends stops in sRGB. Vivid pairs such as blue to yellow can look grey in the middle.
Randomize and harmony
Presets - 36 gradients, click to load
Use it in real designs
Hero banner
Button
Card
A card background using your gradient.
Gradient text
Made with background-clip: text and a transparent text colour.
Contrast checker - worst point, not a pass for the whole gradient
WCAG contrast is defined for a solid text colour on a solid background colour. A gradient has no single contrast value, so this checker reports the worst point: white and black text against your lightest and darkest stops. Never call a whole gradient "accessible" from one number.
If the worst point is below 4.5:1 for normal text, add a dark or light scrim (a semi-transparent overlay) behind the text, move the text to the most readable part, or use bold large text. Always check the text at its least readable point, not at the average colour.
Colours from an image (on your device only)
Pick an image file. Its colours are read in your browser with FileReader and canvas. The image is never uploaded and no remote image is fetched, so there is no CORS problem.
Import existing CSS
Copy the code
Download as an image
PNG export uses the canvas angle conversion rad = (cssDeg - 90) x PI / 180, because canvas createLinearGradient takes coordinates and createConicGradient starts at 0 = east. Canvas blends in sRGB only, so a Smooth (OKLCH / LAB) PNG can differ slightly from the CSS preview.
Favourites and recent gradients
Recent (last 8)
Favourites and recent gradients are saved in your browser only (localStorage). No account, no server, nothing is sent anywhere.
Browser support: linear and radial gradients work in Chrome 26+, Firefox 16+, Safari 7+, Edge 12+ and IE 10+. Conic gradients work in Chrome 69+, Firefox 83+, Safari 12.1+ and Edge 79+, and do not work in Internet Explorer. Repeating gradients follow the same support as their base type.
A good gradient is two or three colours, one clear direction, and a smooth middle - start from a preset, then make it yours.
How to use the Gradient Generator in 3 steps
A gradient is a smooth blend between two or more colours. Designers use gradients for hero banners, buttons, cards, backgrounds and gradient text - and a good one makes a plain page look modern in seconds.
Step 1: pick a type - Linear for a straight blend, Radial for a glow from a centre point, Conic for a colour wheel or pie chart, or turn on Repeating for stripes and rings. Step 2: click the stops bar to add colours, drag stops to move them, and set the angle, centre or start angle. Step 3: copy the CSS, the Tailwind class or the SVG snippet, or download the gradient as a PNG or JPG image.
CSS gradient angle table
| Angle | Keyword | Direction |
|---|---|---|
| 0deg | to top | Bottom to top |
| 45deg | to top right | Bottom-left to top-right |
| 90deg | to right | Left to right |
| 135deg | to bottom right | Top-left to bottom-right |
| 180deg | to bottom (default) | Top to bottom |
| 225deg | to bottom left | Top-right to bottom-left |
| 270deg | to left | Right to left |
| 315deg | to top left | Bottom-right to top-left |
Remember: 0deg is up, and the angle grows clockwise. A keyword such as "to bottom right" is not exactly 135deg on a non-square box, because the keyword aims at the corner while the angle is fixed - this tool always emits exactly what you picked, angle or keyword direction, so the preview matches the CSS.
Gradient types explained
Linear: colours blend along a straight line at your angle. The most common type - use it for page backgrounds, hero banners and buttons.
Radial: colours spread out from a centre point. Choose Circle or Ellipse, set the centre and the size keyword (farthest-corner is the default). Use it for glows, spotlights and soft vignettes.
Conic: colours sweep around a centre point, like a pie chart or a colour wheel. The "from" value is the start angle: 0deg is the top, clockwise. Pie charts use double-position stops, for example red 0deg 120deg.
Repeating: the same gradient repeats. Repeating linear gradients make stripes, repeating radial gradients make rings, and repeating conic gradients make repeated wedges. Hard stops - two stops at the same position - are the key technique for sharp stripe edges.
Browser support
| Gradient type | Chrome | Firefox | Safari | Edge | Internet Explorer |
|---|---|---|---|---|---|
| Linear / radial | 26+ | 16+ | 7+ | 12+ | 10+ |
| Conic | 69+ | 83+ | 12.1+ | 79+ | Not supported |
Gradient Generator FAQ
How do I create a CSS gradient?
Pick a type (linear, radial or conic), add 2 to 8 colour stops, set the angle or centre, then copy the CSS. This tool gives you two lines: a solid background-color fallback using your first stop, then background-image with the gradient. Paste both lines into your stylesheet. For example: background-color: #ff512f; background-image: linear-gradient(135deg, #ff512f 0%, #dd2476 100%);
What angle should I use - what do 0°, 90°, 135° and 180° mean?
In CSS, 0deg points up (to top) and the angle increases clockwise: 90deg points to the right, 180deg points down (to bottom, the default), and 270deg points to the left. 135deg runs from top-left to bottom-right, and 45deg runs from bottom-left to top-right. This is the opposite of school maths, where 0 degrees points right and angles increase counter-clockwise. Use the angle dial or the 8 quick-direction buttons in this tool and the live mapping line shows the direction for the angle you picked.
Why does my gradient look grey or muddy in the middle?
By default CSS blends colours in sRGB, and the straight path between two vivid colours can pass through grey - blue to yellow is a classic example. The fix is to blend in a perceptual colour space instead. Switch this tool to Smooth (OKLCH / LAB) and it inserts extra intermediate stops calculated in CIE LAB, so the middle stays vivid. Adding a middle stop by hand, or using a colour from between the two ends, also helps.
How do I make a transparent / fade-to-transparent gradient?
Set a stop's opacity below 100%. For a fade to transparent, make the last stop the same colour as the one before it with 0% opacity, for example #ff512f 0%, rgba(255, 81, 47, 0) 100%. This tool never drops alpha silently: with HEX output it writes 8-digit HEX (#RRGGBBAA), with RGB output it writes rgba(), and with HSL output it writes hsla().
Is text readable on a gradient? What is gradient contrast?
WCAG contrast is defined for a solid text colour on a solid background colour, so a whole gradient has no single contrast value and must never be called accessible from one number. This tool reports the worst point: white and black text against your lightest and darkest stops. If the worst point is below 4.5:1 for normal text, add a dark or light scrim (a semi-transparent overlay) behind the text, move the text to the most readable part of the gradient, or use bold large text, and always check the text at its least readable point.
Do I need vendor prefixes for gradients in 2026?
No, not by default. The standard gradient syntax has been supported without prefixes since about 2014. The old prefixed syntax reverses the direction, so adding prefixes with the modern direction points the gradient the wrong way in old browsers. This tool does not emit prefixes by default; an optional legacy-prefix checkbox is available, and it flips the direction correctly. Browser support: linear and radial gradients work in Chrome 26+, Firefox 16+, Safari 7+, Edge 12+ and IE 10+. Conic gradients work in Chrome 69+, Firefox 83+, Safari 12.1+ and Edge 79+, and do not work in Internet Explorer.
Related tools
Last updated: 20 November 2026
No comments:
Post a Comment