A smooth gradient can make a plain button, banner or background look designed instead of flat. This free gradient generator turns two colours and an angle into ready-to-use CSS, with a live preview so you can see the result before you copy the code.
Pick your two colours, drag the angle slider, and copy the finished CSS into your website or design file. You can also swap the colours or shuffle a random gradient when you need a fresh idea. Everything runs in your browser and nothing is uploaded.
Tip: 90 degrees runs left to right, 180 degrees runs top to bottom, and 0 degrees runs bottom to top. Paste the copied line into your stylesheet or a style attribute.
How to Use This Gradient Generator
- Pick a first colour, such as the main colour of your brand or page.
- Pick a second colour that it blends into.
- Drag the angle slider to change the direction of the blend.
- Click Copy CSS to copy the finished line of code.
- Click Swap Colours to flip the blend, or Random Gradient for a new idea.
What Makes a Good Gradient
A good gradient uses colours that sit near each other on the colour wheel, or one colour with a lighter and a darker version of itself. Two colours that clash, such as bright red and bright green, can look harsh, while colours that are too close together can look like one flat colour. The angle matters too: a gentle left-to-right blend suits wide banners, while a top-to-bottom blend suits page backgrounds. If you need a set of colours that sit well together, build one with the Color Palette Generator.
Always test a gradient with real text on top of it. White text works on dark gradients and dark text works on light ones, but a gradient that runs from light to dark can make one side of your text hard to read. If that happens, pick a narrower range of colours. Copy the CSS from this tool into your stylesheet and use the same gradient across your site for a consistent look.
Frequently Asked Questions
Is this gradient generator free?
Yes, it is completely free to use, with no account and no sign-up. You can build as many gradients as you like.
What CSS does the tool give me?
It gives you one line of CSS, such as background: linear-gradient(90deg, #0B2239, #C9A227);. The number is the angle in degrees and the two values are the hex colours. Paste the line into your stylesheet or a style attribute, and it works in all modern browsers.
Can I use the gradient on a button?
Yes. Paste the copied CSS line into the style of your button, banner or background. Gradients work on buttons, cards, headers and page backgrounds, and they look best when the text on top has good contrast.
What angle should I choose?
A 90-degree angle runs left to right and is a safe start for banners and buttons. A 180-degree angle runs top to bottom and suits page backgrounds, while a 45-degree angle gives a diagonal blend. Try each one and keep the version that looks calmest with your text on top.
Do I need to create an account?
No. Everything runs in your browser and nothing you pick or copy is uploaded or stored by this site.
Disclaimer: colours and gradients can look slightly different on every screen, so check your gradient on the device and browser where your visitors will see it before you publish.
More free tools: see all free tools, and try the Color Palette Generator and the Font Pairing Generator.
Before you publish a gradient, try it on the real page with your real heading and text. If the blend looks smooth and the text stays easy to read, keep it. Save the CSS line in a notes file, and reuse the same two colours and angle across your banners, buttons and backgrounds so your site looks consistent everywhere. If the heading needs a font to match, try the Font Pairing Generator.