ToolJutsu
All tools
Developer Tools

CSS Gradient to Image

Render a CSS gradient as a downloadable image.

Gradient type
Color stops
#22d3ee
0%
#7c3aed
100%
Output size

Dimensions are clamped between 16 and 4096 pixels.

Live preview

Preview is scaled to fit — the exported PNG is the full 1200 × 630 pixels.

CSS background
background: linear-gradient(90deg, #22d3ee 0%, #7c3aed 100%);
Processed on your device. We never see your files.

How to use CSS Gradient to Image

What this tool does

This tool builds a CSS gradient visually and turns it into a raster image you can download. You choose a linear or radial gradient, set the angle for linear ones, and add as many color stops as you like — each with its own color and position. A live <canvas> preview updates as you work, drawn with the browser’s createLinearGradient and createRadialGradient. When you are happy, export the result as a PNG at the dimensions you need, and copy the equivalent CSS background value to use directly in a stylesheet.

Why you might need it

A CSS gradient is perfect inside a web page, but plenty of places cannot run CSS. Social share images, email backgrounds, slide decks, app splash screens, placeholder artwork, and design mockups all need an actual image file. Rebuilding a gradient by hand in an image editor is fiddly and rarely matches the CSS version exactly. This tool closes that gap: design the gradient once, and walk away with both a pixel-accurate PNG and the CSS string that produces the same result. The size presets cover the most common targets — 1920 × 1080 for wallpapers and slides, 1200 × 630 for Open Graph share cards, and 800 × 800 for square thumbnails — and custom dimensions handle everything else.

How to use it

  1. Pick Linear or Radial as the gradient type.
  2. For a linear gradient, drag the Angle slider — points up, 90° points right.
  3. Adjust each color stop: click the color swatch to change its color, and drag the slider to move its position.
  4. Use Add color stop for multi-color blends, or Remove to delete one (a gradient always keeps at least two).
  5. Choose an output size — a preset, or type custom width and height.
  6. Check the live preview, then click Download PNG to save the image.
  7. Copy the CSS background string if you also want the gradient in code.

Common pitfalls

The most common mistake is expecting the on-screen preview to be full size — it is scaled to fit the page, but the exported PNG is always the exact pixel dimensions you set, so a 1920 × 1080 export really is that large. Another is overlapping stop positions: if two stops sit at the same percentage you get a hard edge rather than a blend, which is sometimes intentional and sometimes a surprise. Very large dimensions produce big files and use more memory, so the tool caps width and height at 4096 pixels. Finally, remember that a radial gradient here is centered and circular; if you need an off-center or elliptical radial, the CSS string is the better starting point since CSS offers more positioning options than a single exported image can capture.

Tips and advanced use

For social share cards, start from the 1200 × 630 preset — that is the size most platforms expect, and getting it right avoids awkward cropping. When you want a subtle background rather than a bold one, place your two stops close in hue and lightness; a gentle shift reads as texture instead of a statement. Multi-stop gradients can simulate effects like a sunset or a metallic sheen — add three or four stops and nudge their positions until the bands feel right. Keep the CSS string for any gradient that lives on a real web page, because CSS scales to any element size for free and stays crisp on high-density displays; reserve the PNG for fixed-size assets. And since the whole process — preview, export and all — runs inside your browser, you can design backgrounds for unreleased products or private mockups without anything leaving your device.

Frequently asked questions

What image format does the export use?
The tool exports a PNG. PNG is lossless, so the gradient stays perfectly smooth with no compression banding, and it supports the exact RGB values you chose. The downloaded file is named after the dimensions you set, for example gradient-1200x630.png.
Why does the CSS angle look different from the canvas?
It does not — they match. CSS gradient angles start at 0 degrees pointing straight up and increase clockwise. The tool converts that convention into the start and end points the HTML canvas uses, so the preview, the export and the CSS string all produce the same gradient.
Can I use the CSS string and the image interchangeably?
For solid backgrounds, yes — the CSS background string and the exported PNG render the same gradient. Use the CSS string when the element lives in a real web page so it scales for free, and use the PNG when you need a fixed-size asset such as a social share image or an email background.
Is my gradient or image uploaded anywhere?
No. The gradient is painted onto an HTML canvas in your browser and exported with the browser's own toBlob function. No image data is sent to a server, so the tool works offline and your designs stay private.
How many color stops can I add?
A gradient needs at least two stops, and you can add more to create multi-color blends. Each stop has a color and a position from 0 to 100 percent; the tool sorts them by position automatically so the result is always valid.

Related tools