Developer

How to Create a CSS Gradient

4 min read Updated 30 June 2026

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

  1. 1Open the CSS Gradient Generator at /dev/gradient-generator — it loads instantly with a default orange-to-charcoal gradient already in the preview.
  2. 2Set the Start color by clicking the first color swatch and picking a shade (or type a hex value like #ff7a18).
  3. 3Set the End color the same way with the second swatch — this is the color the gradient fades into.
  4. 4Under Shape, choose a Type: Linear for a straight directional fade, or Radial for a fade that spreads out from the center.
  5. 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.)
  6. 6Watch the Preview panel update live as you change colors and angle, so you can dial it in by eye.
  7. 7When it looks right, read the generated snippet — something like background: linear-gradient(90deg, #ff7a18 0%, #1d2330 100%);
  8. 8Click Copy CSS to copy the declaration to your clipboard, then paste it onto any element in your stylesheet.
Try it now — it's free
Runs in your browser. No upload, no sign-up.
Open CSS Gradient Generator

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?
A complete, ready-to-paste declaration. For a linear gradient you'll get something like `background: linear-gradient(90deg, #ff7a18 0%, #1d2330 100%);`, and for radial you'll get `background: radial-gradient(circle, ...);`. Click Copy CSS and paste it onto any element.
Can I make a radial gradient too?
Yes. Under Shape, switch the Type from Linear to Radial and the colors will spread out from the center instead of fading along a line. The angle field is disabled for radial gradients because they have no single direction.
Do I need to sign up or install anything?
No. The CSS gradient generator is free with no account and no limits, and it runs entirely in your browser, so there's nothing to install and nothing gets uploaded.
Which colors should I start with?
Two colors that are close in tone usually read as a subtle, professional fade, while contrasting colors make a bold, eye-catching one. The live preview updates as you change each swatch, so the easiest approach is to experiment and stop when it looks right.

Tools used in this guide

Related guides