Small Tools
Frontend utility

CSS Gradient Generator

Create a two-color linear-gradient CSS declaration.

● This tool runs entirely in your browser. Your input is never uploaded to our servers.

Set the options above to generate a CSS declaration. No text input is required.

Output
Your result will appear here…

How to use CSS Gradient Generator

  1. Set the Angle (degrees).
  2. Choose the First color and the Second color.
  3. Run Generate CSS and copy the resulting line.

Example

Input / settings:

Angle 90, first color #0f172a, second color #38bdf8

Output:

background: linear-gradient(90deg, #0f172a, #38bdf8);

Chrome accepts this value as a valid background. The same colors at 180deg would run from top to bottom.

When to use

Overview

CSS Gradient Generator writes a single declaration, background: linear-gradient(…), from an angle and two colors picked with native color pickers. The angle is in degrees: 0deg points up, 90deg points right and 180deg points down. It makes two-stop linear gradients only, with no color positions, radial gradients or conic gradients.

Supported input

angle and two colors

Output details

CSS background declaration

Common mistakes

Practical tips

Privacy and security

This tool runs entirely in your browser. Your input is never uploaded to our servers. The declaration is assembled locally from three values, and nothing is uploaded or stored.

References

Frequently asked questions

Why does a gradient at 0 degrees go upward?

In CSS, 0deg points to the top and angles increase clockwise, so 90deg runs left to right and 180deg runs top to bottom.

Can I add more than two colors?

No. The generator writes exactly two color stops. Add more stops by editing the generated value.

Is the generated value valid CSS?

With colors chosen in the pickers it is. The example value above is accepted by Chrome's CSS support check.

Related tools