Category: Developer tools

CSS Gradient Generator

System ideaMissing a tool?

Build a linear or radial gradient and copy the CSS declaration

Choose linear or radial, set two or three hex colours and an angle, preview the browser's own rendering, then copy the complete background-image declaration.

Output
background-image: linear-gradient(135deg, #0f7b63 0%, #1f4f7a 100%);

Everything on this page is processed in your browser. Nothing is uploaded.

What this tool does

This CSS gradient generator turns the gradient you dial in on screen into one line you can paste straight into a stylesheet. There are two kinds: a linear-gradient with an angle in degrees, and a radial-gradient using the circle shape. Two colour stops are used by default, or three when the middle-colour toggle is on, and the stop positions are fixed — 0% and 100% for two stops, 0%, 50% and 100% for three, with the middle stop locked at 50% and no way to drag it. The angle slider runs from 0 to 360 degrees in five-degree steps and is rounded to a whole number in the output; it applies to linear gradients only, and has no effect on a radial gradient. Colours come from native colour inputs, so every value in the output is a six-digit hex colour. The preview is not a simulation: the same gradient value is handed to the browser as a background image, so what you see is the browser's own rendering of the declaration you are about to copy. The output is a complete declaration in the form background-image: linear-gradient(135deg, #48dbfb 0%, #006ba6 100%);, property name and trailing semicolon included, ready to drop into a rule, and one button copies the whole thing. Everything updates as the controls move, with no generate button. The limits are just as clear. Three colour stops is the ceiling and their positions cannot be edited. There is no conic-gradient, and no repeating-linear-gradient or repeating-radial-gradient. A radial gradient is always a centred circle at its default extent, so there is no ellipse, no closest-side or farthest-corner sizing and no at-position syntax. Colour keywords, rgb(), hsl() and eight-digit hex are not accepted, which also rules out per-stop alpha and transparency. There are no interpolation hints, no in oklch or in srgb colour-space syntax and no easing between stops. There is no random button, preset gallery, palette import or saved gradient; no vendor prefixes, no background shorthand and no rule wrapped in a selector; no stacked background layers in one declaration; no PNG or SVG export and no download; and no Tailwind, SCSS or styled-components output. Gradient text, animation and gradient borders are out of scope too. The colours and the angle stay in the browser, nothing is uploaded and no asset is fetched at run time.

How to use it

  1. Switch between linear and radial, then pick the start and end colour from the native colour inputs.
  2. Turn on the middle colour for a third stop at 50%, and set the angle for a linear gradient.
  3. Check the live preview and copy the complete background-image declaration into your stylesheet.

Privacy

This tool runs entirely in your browser. Your input is never uploaded, stored or shared — closing the tab removes it.

Frequently asked questions

What is a CSS gradient generator?
It is a visual editor for a gradient you would otherwise write by hand: you pick the kind, the colours and the direction, watch a preview, and copy the resulting CSS. Here the output is a full background-image declaration.
Can I create radial gradients as well as linear ones?
Yes. Both kinds are available. The radial gradient uses the circle shape at its default extent and is always centred, so there is no ellipse, extent keyword or at-position control, and the angle does not affect it.
What does 135deg mean in a CSS gradient?
It is the direction the linear gradient runs in: 0deg goes bottom to top, 90deg left to right, and 135deg from bottom-left to top-right. The slider moves in five-degree steps and rounds to a whole number in the output.
Do I get the CSS code for the gradient I build?
Yes, and it is the whole declaration — background-image, the gradient function and the trailing semicolon — copied by one button. The preview above it is the browser rendering that same value as a background image.
How many colour stops can I use?
Two, or three with the middle-colour toggle on. The positions are fixed at 0% and 100%, or 0%, 50% and 100%, and the middle stop cannot be moved. CSS itself allows more stops, but this tool does not expose them.