Skip to main content

Radial Gradient Generator

Generate CSS radial-gradient code with a live preview.

Reviewed for accuracy by the Math Ora X team Last updated

Result

About the Radial Gradient Generator

Generates CSS for a radial gradient (color radiating from a center point) between two colors, with a live preview you can copy.

How to use

Enter the center and edge colors, then click Generate.

Worked example

#fde047 center to #f97316 edge → a sunburst effect.

How to use this calculator

  1. Choose the gradient shape, size, and center position.
  2. Pick the colors and decide where each color stop should appear.
  3. Adjust the values in the tool and watch the live preview update.
  4. Copy the generated CSS radial-gradient code into your stylesheet.

The formula explained

$$ \text{background} = \text{radial-gradient}(\text{shape size at position}, \text{color stop 1}, \text{color stop 2}, \dots) $$

  • \(\text{shape}\) = The gradient shape, usually circle or ellipse
  • \(\text{size}\) = How far the gradient spreads, such as closest-side or farthest-corner
  • \(\text{position}\) = Where the gradient center sits, such as center or 20% 30%
  • \(\text{color stop}\) = A color and optional stop position that defines how the gradient changes

Step by step method

  1. Start with the default gradient or enter your own shape, size, and position values.
  2. Add at least two colors so the tool can build a visible radial gradient.
  3. Set stop positions if you want tighter control over where each color begins and ends.
  4. Check the preview to confirm the gradient looks right, then copy the CSS output.

Worked example

Here is a simple example for a soft spotlight effect centered in the middle of a card.

  1. Choose a circle centered at the middle and use two colors, white at 0% and blue at 100%.
  2. The tool generates a CSS value like \(\text{radial-gradient}(\text{circle at center}, \text{white} 0\%, \text{blue} 100\%)\).
  3. Paste that into a CSS background property such as \(\text{background: radial-gradient(circle at center, white 0\%, blue 100\%);}\).

Answer. background: radial-gradient(circle at center, white 0%, blue 100%);

Tips and common mistakes

  • Use contrasting colors if you want the shape of the gradient to stand out clearly.
  • Move the position away from center to create a highlight or spotlight effect.
  • Try different size keywords like closest-side and farthest-corner to change the spread.
  • If the gradient looks harsh, add more intermediate color stops for a smoother blend.

Frequently asked questions

How is radial different from linear?+

Radial gradients spread outward from a point; linear gradients run along a line.

Can I change the shape?+

This uses an ellipse at center; edit the CSS for 'circle' or other positions.

Facebook Twitter WhatsApp