{ } 2DevKit
Tools / Generators

Random Color Generator

Generate random colors and palettes, preview swatches, inspect WCAG contrast ratios, copy HEX/RGB/HSL and export CSS or JSON.

Colors are generated locally using Web Crypto. Contrast ratios are calculated against pure black and white, not a guarantee of WCAG compliance for every text size or UI component.

Everything runs locally in your browser.

What is Random Color Generator?

Random color generators are useful for design exploration, data visualization mockups and testing different UI palettes. This tool generates colors using browser cryptographic randomness, renders previews and calculates contrast ratios against pure black and white. Contrast ratios alone do not guarantee WCAG compliance for every design: verify actual font sizes and components before publishing.

How to use this tool

  1. Choose between 1 and 50 colors and a HEX, RGB or HSL output format.
  2. Generate the palette and inspect its swatches and black/white contrast ratios.
  3. Copy individual colors or export a CSS variable list, JSON array or text file.

Example

--random-color-1: #4a83c1; /* example only */

Related developer tools