Text Style & Fun

Random Hex Code Generator - Hex Colors With RGB & HSL

Generate random hex color codes with a live swatch, RGB and HSL. Vivid, pastel, light, dark or gray, one or 48 at a time.

100% Client-SideNo Tool Data StoredFree to UseNo Account Needed
Random Hex Color Generator

    Tap a color to copy its hex code. Any color draws evenly from all 16,777,216 hex codes; the tones keep to a band of saturation and lightness. Colors are picked in your browser.

    How to Use Random Hex Color Generator

    1. 1

      Pick a tone (any color, vivid, pastel, light, dark or grays) and how many colors you want.

    2. 2

      Tap New colors until you like the set. Each swatch shows its hex, RGB and HSL values.

    3. 3

      Tap a swatch to copy its code, or use Copy all or Copy as CSS for the whole set.

    About Random Hex Color Generator

    Generate random hex color codes and see each one as a swatch, with its RGB and HSL values underneath. Keep to a tone when you need colors that work together, such as pastels for a soft palette or dark shades for a background, and copy single codes, the full list or ready-made CSS variables.

    How hex codes work

    A hex code is written #RRGGBB. Each pair is a number from 00 to FF in base 16 (0 to 255 in decimal) for red, green and blue. #FF8800 has full red, about half green and no blue, which makes orange. A three-digit shorthand like #F80 means #FF8800.

    Common hex codes

    • White: #FFFFFF, Black: #000000, Mid gray: #808080
    • Red: #FF0000, Green: #00FF00, Blue: #0000FF
    • Yellow: #FFFF00, Cyan: #00FFFF, Magenta: #FF00FF
    • Orange: #FFA500, Purple: #800080, Pink: #FFC0CB

    Tones

    • Vivid: fully saturated, mid lightness. Bright accents and buttons.
    • Pastel: soft, light and gently saturated. Backgrounds, cards and illustrations.
    • Light and Dark: wide hue range at high or low lightness. Page backgrounds and text.
    • Grays: nearly neutral, from near-black to near-white.

    Ways to use random hex codes

    • Design and art: break out of your usual palette or start a mood board.
    • Web development: placeholder colors, tag and avatar colors, test data for color pickers.
    • Games and challenges: draw something using only the colors you get, or guess the color from its code.
    FRI

    Built by

    Fateh Raiyan Ishmum

    Full-stack dev since 2020. Full-stack web developer since 2020. Builds privacy-first, open-web tools. Specialises in Next.js, TypeScript, and performance-focused design.

    Frequently Asked Questions

    A # followed by six characters from 0-9 and A-F. Each pair is one channel of an RGB color: red, green, then blue, from 00 (none) to FF (full). #FF0000 is pure red, #00FF00 pure green, #0000FF pure blue, #FFFFFF white and #000000 black.

    With Any color, yes: every one of the 16,777,216 hex codes (256 × 256 × 256) has the same chance. The other tones pick a random hue and a saturation and lightness inside that tone's band, so every result still differs.

    Yes. Set Tone to Vivid, Pastel, Light, Dark or Grays. Pastels are soft and light, vivid colors are bright and saturated, and Grays stay close to neutral from near-black to near-white.

    Tap any swatch to copy its hex code. Copy all gives the whole list, one code per line, and Copy as CSS gives custom properties such as --color-1: #a1b2c3; ready to paste into a stylesheet.

    Yes. Code style switches between #A1B2C3, #a1b2c3 and A1B2C3 with no #. The swatch and the copied text both follow it.

    Two other ways to write the same color. RGB gives the red, green and blue amounts from 0 to 255. HSL gives the hue as an angle on the color wheel (0-360), then saturation and lightness as percentages. CSS accepts all three.

    More Free Tools

    Most Popular