Skip to content

Color Picker

Drag the circle and the rainbow bar, or use the arrow keys.

#FF6347

Type or paste any color in any field: #ff6347, rgb(255 99 71), hsl(9 100% 64%) or a name like tomato.

Shades & tints

Click one to use it

CSS code

Text color
Background color
HTML text
HTML box

Contrast check (WCAG)

With white –
Aa Your color as text
Aa White text on it
  • AA
  • AAA
  • AA Large
  • AAA Large
With black –
Aa Your color as text
Aa Black text on it
  • AA
  • AAA
  • AA Large
  • AAA Large

AA needs 4.5:1 for normal text and 3:1 for large text (24px, or 19px bold). AAA needs 7:1 and 4.5:1.

HTML Color Picker – HEX, RGB & HSL Color Codes

What is an HTML Color Picker?

An HTML color picker lets you choose a color by eye and gives you the code to use it on a web page. Computers don’t understand “a warm orange-red”, they understand #FF6347 or rgb(255, 99, 71). The picker above does the translating: move the circle until the color looks right, then copy the code in whatever format you need.

It also works the other way round. Got a color code from a designer, a brand guide or someone else’s CSS? Type it in and you’ll see the color, its other formats, lighter and darker versions, and whether text on it is easy to read. Everything happens in your browser, so it’s instant and nothing is uploaded.

How to Use the Color Picker – Step by Step

Five short steps, from picking a color to pasting it into your page.

Step 1 Pick a Color

Drag the rainbow bar to choose the hue, then drag the circle in the big square: left to right makes the color stronger, top to bottom makes it darker. It works with a mouse, a finger or the arrow keys (hold Shift for bigger steps).

  • Random gives you a fresh, pleasant color when you need ideas.
  • Pick from screen (Chrome and Edge) lets you grab any color you can see on your screen.
  • System picker opens your device’s own color dialog.

Step 2 Or Type a Color You Already Have

Every field accepts every format, so just paste what you’ve got into any of them: #ff6347, ff6347, #f63, rgb(255, 99, 71), hsl(9 100% 64%) or a name like tomato. The picker jumps to that color and the other fields follow. In the RGB field plain numbers like 255 99 71 work too.

Step 3 Copy the Code You Need

  • HEX for CSS, HTML and most design tools.
  • RGB and HSL for CSS when you want to tweak a value by hand.
  • HSV for apps that use it, like Photoshop (where it’s called HSB).
  • CMYK as a starting point for print. Screen and paper colors differ, so check a real print.

Under the swatch you also see the closest color name. Click it if you’d rather use a name.

Step 4 Grab Ready-Made CSS

The CSS code box has the lines you’d otherwise type yourself: color: …; for text, background-color: …; for backgrounds, and small HTML examples with the style already in place. Switch between HEX, RGB, HSL and Name to get the format you like.

Step 5 Check Contrast and Try Shades

The contrast check shows your color as text on white and on black, and as a background with white or black text, each with its WCAG contrast ratio. Green means it passes. If it doesn’t, pick a darker or lighter step in Shades & tints: one click and it becomes your color. Your last color is remembered in this browser for next time.

How to Change Text Color in HTML

Text color is set with the CSS color property. The quickest way is a style attribute right on the element. Pick a color above, copy its code, and paste it after color:.

Inline style

<p style="color: #FF6347;">This text is tomato red.</p>
<p style="color: rgb(37, 99, 235);">This one is blue.</p>

This text is tomato red.

This one is blue.

With a CSS class (better for more than one element)

<style>
  .note { color: hsl(142, 71%, 30%); }
</style>

<p class="note">Saved! Your changes are live.</p>

Saved! Your changes are live.

💡 You may see <font color="red"> in old tutorials. Browsers still show it, but it’s obsolete in HTML5. Use color in CSS instead: it does the same thing and is easy to change later.

How to Change the Background Color in HTML

Background color uses the CSS background-color property. Put it on <body> to color the whole page, or on any element (a div, a table cell, a button) to color just that box. When you change a background, check the text color too, so the text stays easy to read.

Page and box backgrounds

<body style="background-color: #F0F8FF;">

<div style="background-color: #0B0F19; color: #A3E635; padding: 12px;">
  Lime text on a near-black box
</div>
Lime text on a near-black box

The same in a stylesheet

body {
  background-color: aliceblue;
}
.banner {
  background-color: #FFD700;  /* gold */
  color: #111827;             /* dark text, 13:1 contrast */
}
A gold banner with dark text

💡 Want a color behind just a few words? Wrap them in a span: <span style="background-color: yellow;">highlighted</span>. For text that is marked as highlighted, <mark> does it for you.

HTML Color Codes Explained

There are several ways to write the same color. They all end up as a mix of red, green and blue light on your screen, 256 levels each, which gives about 16.7 million colors. Here is the same tomato red written each way:

FormatExampleWhat it means
HEX #FF6347 The most common way. Two hex digits each for red, green and blue (00 to FF).
Short HEX #F00 Three digits when each pair repeats: #F00 is the same as #FF0000.
RGB rgb(255, 99, 71) Red, green and blue from 0 to 255. Easy to read and tweak.
RGB + alpha rgb(255 99 71 / 50%) The same color, half see-through. (The older spelling is rgba(255, 99, 71, 0.5).)
HSL hsl(9, 100%, 64%) Hue (0 to 360 on the color wheel), saturation and lightness. Best for making lighter or darker versions.
Name tomato One of the 148 CSS color names. Easy to remember, but only those 148 colors.

Upper or lower case doesn’t matter: #ff6347 and #FF6347 are the same color. Need transparency in HEX? Add two more digits for alpha: #FF634780 is about 50% see-through.

HTML Color Names (All 148)

Every color name that works in HTML and CSS, with its HEX and RGB code. Search by name or code, or filter by color family. Click a color to load it into the picker and copy its HEX code. Back to the picker ↑

Showing all 148 colors

Frequently Asked Questions

How do I pick a color and get its HTML color code?

Drag the circle in the big square to choose how light and how strong the color is, and drag the rainbow bar to change the hue. The HEX, RGB, HSL, HSV and CMYK codes update as you move. Click Copy next to the one you need and paste it into your HTML or CSS. You can also type a code or a color name like "tomato" into any field.

How do I change the text color in HTML?

Use the CSS color property. Inline it looks like <p style="color: #FF6347;">Hello</p>. In a stylesheet you write p { color: #FF6347; }. The old <font color="red"> tag still works in browsers but is obsolete in HTML5, so use CSS instead.

How do I set a background color in HTML?

Use the CSS background-color property, for example <body style="background-color: #F0F8FF;"> or, in a stylesheet, body { background-color: aliceblue; }. It works on any element: a div, a table cell, a button. Pick a text color with enough contrast so the text stays easy to read.

What are HTML color codes?

They are the ways to write a color in HTML and CSS. A HEX code like #FF6347 gives red, green and blue as two hex digits each (00 to FF). RGB writes the same three numbers in decimal: rgb(255, 99, 71). HSL describes hue, saturation and lightness: hsl(9, 100%, 64%). All three describe the exact same color, so use whichever you find easiest.

How many HTML color names are there?

There are 148 named colors in CSS, from aliceblue to yellowgreen. A few are duplicates with two spellings, like gray and grey, or aqua and cyan. Names are not case-sensitive, so Tomato, tomato and TOMATO all work. The full list with HEX and RGB values is on this page; click any of them to load it into the picker.

HEX, RGB or HSL: which should I use?

They all work in every browser. HEX is the most common in design tools and is short to copy. RGB is handy when you want transparency, like rgb(255 99 71 / 50%). HSL is the easiest to tweak by hand: change the last number to make a color lighter or darker without changing its hue.

What is a good contrast ratio for text?

WCAG, the web accessibility guidelines, asks for at least 4.5:1 between normal text and its background (level AA) and 3:1 for large text (about 24px, or 19px bold). Level AAA asks for 7:1 and 4.5:1. Black on white is 21:1, the maximum. The contrast check under the picker shows these numbers for your color on white and on black.

Is this color picker free? Does it upload anything?

It is free and works without signup. Everything runs in your browser and nothing is uploaded. The only thing it remembers is your last color, saved in your own browser so it is still there next time.