How to Create a CSS Gradient
A CSS gradient is one of the cheapest ways to make a flat design look intentional — a soft fade behind a hero section, a colorful button, a card header that catches the eye. The syntax isn't hard, but remembering whether the angle goes before or after the colors, and which percentages map to which stop, is exactly the kind of thing nobody wants to type from memory.
That's what the Tooldrop CSS gradient generator is for. You choose a start color, an end color, and an angle, watch the result update live, then copy a clean `background: ...;` declaration straight into your stylesheet. It's free, there's no sign-up, and it runs entirely in your browser, so nothing you do leaves your machine.
Step by step
- 1Open the CSS Gradient Generator at /dev/gradient-generator — it loads instantly with a default orange-to-charcoal gradient already in the preview.
- 2Set the Start color by clicking the first color swatch and picking a shade (or type a hex value like #ff7a18).
- 3Set the End color the same way with the second swatch — this is the color the gradient fades into.
- 4Under Shape, choose a Type: Linear for a straight directional fade, or Radial for a fade that spreads out from the center.
- 5For a linear gradient, set the Angle (deg) field — 90 points the fade left-to-right, 180 top-to-bottom, 0 bottom-to-top. (The angle field is disabled for radial gradients, since they have no direction.)
- 6Watch the Preview panel update live as you change colors and angle, so you can dial it in by eye.
- 7When it looks right, read the generated snippet — something like background: linear-gradient(90deg, #ff7a18 0%, #1d2330 100%);
- 8Click Copy CSS to copy the declaration to your clipboard, then paste it onto any element in your stylesheet.
What the css gradient generator actually gives you
The tool builds a standard CSS gradient value and wraps it in a ready-to-paste declaration. With Linear selected you get a snippet like `background: linear-gradient(90deg, #ff7a18 0%, #1d2330 100%);` — the angle in degrees, then each color with its position. Switch to Radial and the output becomes `background: radial-gradient(circle, #ff7a18 0%, #1d2330 100%);`, fanning the colors out from the center instead of along a line.
Because the snippet is plain, valid CSS, you can drop it onto a `<div>`, a button, a section background, or a card without any framework-specific tweaks. It works the same in vanilla CSS, Sass, Tailwind's arbitrary-value syntax, or styled-components.
Understanding the angle
The angle is the single number people most often get wrong. In CSS, the angle describes the direction the gradient travels toward, measured clockwise from pointing straight up. So 0deg fades from bottom to top, 90deg fades from left to right, 180deg fades from top to bottom, and 270deg fades right to left. Diagonal values like 45deg run from bottom-left to top-right.
The generator accepts 0 to 360 and previews the result instantly, so the fastest way to get the angle you want is to nudge the number and watch the preview rather than do the geometry in your head. Radial gradients ignore the angle entirely, which is why the field greys out when you pick that type.
Why it runs in your browser
Generating a gradient is pure math on a few short strings, so there's no reason to send anything to a server — and Tooldrop doesn't. The whole tool runs on-device in your browser. Your color choices never get uploaded, there's nothing to log in to, and there are no usage limits, so you can generate as many gradients as a project needs.
That same model applies across Tooldrop's other developer tools, from a JWT decoder at /dev/jwt-decoder to image converters like /image/png-to-jpg — free, no account, and most processing happening locally so your files and data stay with you.
Frequently asked questions
What CSS does the generator produce?
Can I make a radial gradient too?
Do I need to sign up or install anything?
Which colors should I start with?
Tools used in this guide
Related guides
Paste any JSON Web Token to read its header and payload in seconds — free, private, and entirely in your browser.
Paste messy JSON, beautify or minify it, and catch errors instantly with this free in-browser JSON formatter.
Paste a JSON array of objects and get clean, spreadsheet-ready CSV in seconds — free, private, and entirely in your browser.