Random Hex Color Generator

Random CSS hex colors in the standard #RRGGBB form. Set Count from 1 to 200; the output panel fills with that many lowercase six-digit hex codes, one per line, each prefixed with #. Useful for swatch palettes, design exploration, or test fixtures. For random alphanumeric strings see the random string generator.

Input
Line 1:1 LF cloud_done Saved locally
Result Random Hex Color
0 lines 0 chars

Random CSS hex colors, ready to paste

Each color is a 24-bit value (0 to 0xFFFFFF) formatted as a six-digit lowercase hex string with a leading #. The output is straight CSS: #7ab8d4 works in color:, background-color:, border-color:, and any other property that takes a CSS color.

Set Count between 1 and 200. The output panel emits one color per line. Each draw is independent, so duplicates can appear in larger batches but they are very unlikely below 50 colors.

For arbitrary alphabets use the random string generator with a custom hex pool. For random IDs use the UUID generator. For random numbers in a range use the random number generator.

How to use random hex color generator

  1. 1Open the tool. The input panel can be left empty.
  2. 2Set Count in the option panel (default 10, maximum 200).
  3. 3The output panel fills with that many hex colors, one per line.
  4. 4Click Copy to grab the list.
  5. 5Click Download to save as a plain-text file.

Keyboard shortcuts

Drive TextResult without touching the mouse.

Shortcut Action
Ctrl FOpen the find & replace panel inside the input Plus
Ctrl ZUndo the last input change
Ctrl Shift ZRedo
Ctrl Shift EnterToggle fullscreen focus on the editor Plus
EscClose find & replace, or exit fullscreen
Ctrl KOpen the command palette to jump to any tool Plus
Ctrl SSave current workflow draft Plus
Ctrl PRun a saved workflow Plus

What this tool actually does

Six-digit lowercase hex

Every color is exactly seven characters: # followed by six lowercase hex digits. Pastes straight into CSS, SVG, Figma color fields, and HTML attributes.

Zero-padded values

Small values like 0x00ffaa are padded so the output is always six digits. 0xff renders as #0000ff, not #ff. CSS parsers require the full six.

Bulk count up to 200

Count ranges from 1 to 200. Useful for sampling a large palette or generating fixture colors for a UI test.

Uniform across the 24-bit space

Each color is a uniform sample from the 16,777,216 possible 24-bit RGB values. No bias toward saturated or desaturated colors.

Browser-only

Computed in JavaScript via Math.random() and Number.prototype.toString(16). No upload, no log.

Worked example

Five random colors at default Count 5. Each is six lowercase hex digits with a leading #; pastes straight into CSS.

Input
Count: 5
Output
#7ab8d4
#3e2a91
#fcd56a
#0a4f3c
#b21d44

Settings reference

Option Effect on output
Count How many colors to emit. Default 10, minimum 1, maximum 200. One per line.
Format #RRGGBB, lowercase hex, zero-padded to six digits.
Color space 24-bit sRGB. No alpha channel; if you need #RRGGBBAA, append ff manually.
Distribution Uniform across the 16,777,216 possible values.
Random source Math.random().

FAQ

Can I get a color with alpha?
Not directly. The output is six-digit hex (#RRGGBB). Append two hex digits after copying for #RRGGBBAA; for example, ff for fully opaque, 80 for ~50% opacity.
Why are some colors hard to see?
The pool is uniform across the full 24-bit space, so very dark and very light colors come up as often as any others. Filter the output by hand or use a perceptual color tool for accessible palettes.
Can I get colors in rgb() or hsl() form?
Not in this version. Convert the hex with a separate color tool. The hex form pastes everywhere CSS accepts a color.
Will I see duplicates?
In a 200-color batch, the probability of any duplicate is about 0.1%. For practical purposes, treat each color as unique.
Is the output sent anywhere?
No. The colors are computed in your browser. Nothing leaves the page.