Home › Image Tools › HTML Color Codes

HTML Color Codes

Every named color supported by HTML and CSS, with its HEX, RGB and HSL code. Search by name or code, filter by color family, sort by hue or lightness, and click any color to copy its code. The 216-color web-safe palette is one tab away.

Aa
coral

Advertisement
Advertisement

How to use the HTML Color Codes

  1. Browse or search: scroll the grid, or type a name ("blue", "sea") or a HEX code ("#ff7f50") in the search box.
  2. Filter by color family with the chips, and choose how to sort the grid: by family, name, hue, lightness or HEX.
  3. Pick a copy format: name, HEX, RGB or HSL.
  4. Click a color to copy its code. The detail panel shows every format with its own copy button and the contrast against white and black text.
  5. Need web-safe colors? Open the Web-safe palette tab and click any of the 216 cells to copy its HEX code.

How HTML color codes work

A HEX color code such as #FF7F50 is three pairs of hexadecimal digits for the red, green and blue channels. Each pair runs from 00 (0, none of that light) to FF (255, full intensity), so #FF7F50 means red 255, green 127, blue 80, which is rgb(255, 127, 80) and the named color coral. A three-digit shorthand doubles each digit: #369 is #336699.

HSL describes the same color as hue (0 to 360 degrees around the color wheel: 0 red, 120 green, 240 blue), saturation (0% gray to 100% vivid) and lightness (0% black, 50% pure color, 100% white). It is the easiest format for making a color a little lighter or darker by hand.

FormatExample (coral)CSS usage
Color namecoralcolor: coral;
HEX#FF7F50color: #ff7f50;
HEX with alpha#FF7F5080color: #ff7f5080; (50% opacity)
RGBrgb(255, 127, 80)color: rgb(255 127 80 / 50%);
HSLhsl(16, 100%, 66%)color: hsl(16 100% 66%);

The 16 basic HTML colors

These 16 names date back to HTML 3.2 (1997) and are the ones you will see most often in older code and tutorials. The other names were added from the X11 window system color list.

NameHEXRGBNameHEXRGB
black#0000000, 0, 0silver#C0C0C0192, 192, 192
gray#808080128, 128, 128white#FFFFFF255, 255, 255
maroon#800000128, 0, 0red#FF0000255, 0, 0
purple#800080128, 0, 128fuchsia#FF00FF255, 0, 255
green#0080000, 128, 0lime#00FF000, 255, 0
olive#808000128, 128, 0yellow#FFFF00255, 255, 0
navy#0000800, 0, 128blue#0000FF0, 0, 255
teal#0080800, 128, 128aqua#00FFFF0, 255, 255

Note that the CSS green is a medium green (#008000); the pure, full-intensity green channel is called lime.

Choosing readable text colors

The detail panel shows the WCAG 2 contrast ratio of the selected color against white and black text. The ratio is (L1 + 0.05) / (L2 + 0.05), where L1 and L2 are the relative luminances of the lighter and darker color. Body text needs at least 4.5:1 for level AA and 7:1 for AAA; large text (about 24 px, or 19 px bold) needs 3:1. For example, white text on steelblue reaches only about 4.1:1, while white on navy is well above 7:1. To check any two colors, use the Color Contrast Checker.

Frequently asked questions

How many HTML color names are there?

There are 140 classic HTML color names that every browser supports, such as red, navy, coral and lightgoldenrodyellow. CSS Color Level 4 adds rebeccapurple (#663399), and it also accepts the British spelling grey in seven names (grey, darkgrey, lightgrey, dimgrey, slategrey, darkslategrey, lightslategrey), for 148 keywords in total. This page lists the 141 distinct names.

Are HTML color names case-sensitive?

No. CSS color keywords are case-insensitive, so Red, RED and red all mean #FF0000. Most style guides write them in lowercase, which is how the code is copied from this page.

Do some color names share the same code?

Yes. aqua and cyan are both #00FFFF, and fuchsia and magenta are both #FF00FF. The gray and grey spellings are also identical.

What are web-safe colors?

The web-safe palette is 216 colors made from every combination of the values 00, 33, 66, 99, CC and FF for red, green and blue. It was designed for 1990s screens that could only show 256 colors. Modern displays show millions of colors, so you no longer have to stick to it, but its short codes like #369 are still handy.

Should I use color names or HEX codes in CSS?

Both work in every browser. Names are easier to read in quick prototypes, while HEX, RGB or HSL give you the exact shade you need from a design and are used by most design tools. The rendered color is identical for a name and its HEX value.

Why is "darkgray" lighter than "gray"?

It is a historical quirk. The CSS names came from the X11 color list, where darkgray is #A9A9A9, while gray was taken from the older HTML 3.2 set at #808080. So darkgray ends up lighter than gray.

How do I write a color code in HTML?

Use CSS, for example style="color: tomato" or style="background-color: #FF6347" or color: rgb(255, 99, 71). All three give the same tomato red.

Related tools

Color PickerPick any color and get HEX, RGB, HSL, HSV and CMYK codes, shades and a screen eyedropper.Color Name FinderFind the closest color name for any HEX or RGB color.HEX to RGBConvert HEX colors to RGB and other formats.Color Palette GeneratorGenerate beautiful color palettes and export them.Background RemoverRemove image backgrounds automatically with AI.Image to Text (OCR)Extract text from images, screenshots and photos with OCR in 25+ languages, right in your browser.Image CompressorShrink images to a target size like 100 KB.Image ResizerResize images to any size without losing quality.Compress Image to 20KBShrink any photo to under 20KB (or any target size).Compress JPEG to 50KBShrink photos to under 50KB for forms, passports and exams.HEIC to JPGConvert iPhone HEIC photos to JPG.WEBP to JPGConvert WEBP images to JPG in bulk.PNG to JPGBatch convert PNG images to JPG with a background color.JPG to PNGBatch convert JPG images to PNG.Image CropperCrop images, including circle crops for profile pictures.Rotate & Flip ImageRotate images by any angle or mirror them, one or many at once.Meme GeneratorMake memes with classic templates and custom text.Collage MakerCombine photos into a grid collage.Add Watermark to PhotoAdd a text or logo watermark to one or many photos at once.Blur Image & Face Pixelate ToolBlur or pixelate faces, plates and backgrounds in a photo.Pixelate Image & Pixel Art ConverterTurn any picture into pixel art with retro palettes and dithering.Logo MakerDesign a text logo with fonts, icons and colors, then save SVG or PNG.Certificate MakerDesign certificates from templates and export one or many as PDF.WEBP to PNGConvert WEBP images to PNG, keeping transparency.SVG to PNGConvert SVG graphics to PNG or JPEG at any scale.PNG to ICOCreate multi-size favicon .ico files from PNG.GIF MakerTurn videos and images into GIFs, trim and compress.Business Card MakerDesign business cards and download a print-ready PDF.Flyer MakerDesign printable and social media flyers from free templates.Poster MakerDesign posters in A0–A5 and US sizes and download a print-ready PDF.Invitation Card MakerCreate printable birthday, wedding and party invitations for free.RGB to HEXConvert RGB to HEX with sliders, live swatch and one-click copy.HEX to HSLConvert HEX colors to HSL and back with interactive sliders.RGB to CMYK ConverterConvert RGB and HEX colors to CMYK for print, and back.Color Contrast CheckerCheck WCAG contrast ratios and find accessible text colors.Pantone to HEXLook up approximate HEX, RGB and CMYK values for Pantone colors.AVIF to JPGConvert AVIF images to widely supported JPG.PNG & JPG to WEBPConvert PNG and JPG images to smaller WEBP files.Aspect Ratio CalculatorCalculate image sizes for 16:9, 4:3 and any ratio.Thumbnail Safe ZonePreview YouTube and TikTok thumbnail safe zones.Color Blindness SimulatorSee any image as people with protanopia, deuteranopia, tritanopia or achromatopsia see itAdd Text to ImageAdd styled text layers with outline and shadow to any photo, then downloadThumbnail MakerDesign 1280×720 YouTube thumbnails with templates, bold text and stickersImage Color PickerPick any pixel colour from an image and get HEX, RGB, HSL plus a paletteImage Border AdderAdd a border, rounded corners, matte and shadow to a photo onlineWallpaper GeneratorCreate gradient and pattern wallpapers sized for any phone, tablet or desktopColor Shades GeneratorTurn one HEX color into a 50-950 scale plus tints, shades and tones, ready to export.Round Corners ImageGive any picture rounded, circle or squircle corners and save a transparent PNG.Printable Calendar MakerMake a printable month or year calendar with holidays, then print or save PDF.YouTube Thumbnail GrabberPaste a YouTube link to get every thumbnail size, from HD 1280x720 down to 120x90.Tailwind Color GeneratorTurn one color into a full Tailwind 50–950 shade scale and export the config or CSS.Image Flipper & MirrorMirror photos horizontally or flip them vertically, one image or a whole batch.Printable Planner GeneratorDesign daily or weekly planner pages with your dates and colors, then print them as a PDF.CSS Gradient GeneratorDesign linear, radial and conic CSS gradients with draggable stops and export CSS or PNG.Grayscale Image ConverterTurn color photos into black and white with luma, luminance or average methods and sepia.Graph Paper GeneratorMake printable square, dot, isometric or hex graph paper and download it as PDF, PNG or SVG.Color MixerMix two colors in sRGB, linear, OKLab or OKLCH, or blend them with Photoshop-style modes.Photo FiltersApply 27 one-click photo filters like Vintage, Noir and Teal & Orange with an intensity slider.Lined Paper GeneratorCreate printable lined paper: wide, college or handwriting ruling, Cornell notes, PDF or PNG.Random Color GeneratorGenerate random HEX colors one at a time or in batches, with hue, saturation and lightness ranges.Photo EditorEdit photos online: brightness, contrast, saturation, crop, rotate, flip and filters with undo.Chart MakerMake bar, line, area, pie and doughnut charts from a simple table and download PNG or SVG.Color WheelFind complementary, triadic, analogous and other color harmonies on an interactive wheel.Image SharpenerSharpen soft or slightly blurry photos with a real unsharp mask and before/after view.Venn Diagram MakerMake 2- or 3-circle Venn diagrams from lists; overlaps are found for you. Export PNG or SVG.Invert Image ColorsTurn any picture into a color negative, with R/G/B channel toggles and an intensity slider.Mind Map MakerBuild mind maps fast with keyboard shortcuts and auto layout, then export PNG, SVG or JSON.Image SplitterSplit an image into a rows × columns grid of tiles and download them one by one or as a ZIP.Org Chart MakerType an indented list of names and titles and get a clean org chart to download as PNG or SVG.Image CombinerCombine images side by side, stacked or in a grid, with spacing, background color and alignment.Timeline MakerCreate horizontal or vertical timelines from dated events with colors, then save PNG or SVG.Screenshot BeautifierPut screenshots on gradient backgrounds with padding, rounded corners, shadow and a browser frame.Gantt Chart MakerPlan tasks with dates, progress and dependencies on a Gantt chart, then export PNG or CSV.Image UpscalerEnlarge images 2×, 3× or 4× with Lanczos-3 or bicubic resampling and optional sharpening.Word Cloud GeneratorTurn any text into a word cloud in shapes like a heart or star, then save it as PNG or SVG.Image Metadata ViewerSee a photo's EXIF data: camera, lens, exposure, date and GPS location, then strip it in one click.Pie Chart MakerMake pie and donut charts with labels, percentages and a legend, then download PNG or SVG.Favicon GeneratorMake a favicon.ico, PNG icons, apple-touch-icon and web manifest from an image, text or emoji.Passport Photo MakerMake passport and visa photos for any country and print them on a 4x6 sheet.PNG to SVG ConverterConvert PNG or JPG images to scalable SVG vectors with color and detail control.EXIF RemoverRemove EXIF, GPS location and other metadata from JPG, PNG and WEBP photos.Image DPI ChangerChange the DPI of JPG and PNG images without re-encoding, and see the print size.Online PaintDraw and paint in your browser: brushes, shapes, fill bucket, text, undo and PNG export.Signature MakerDraw or type your signature and download it as a transparent PNG or SVG.Color Palette from ImageExtract the main colors of any photo as HEX codes, CSS variables and a palette PNG.Photo to SketchTurn any photo into a pencil, charcoal or color sketch in your browser and download it.Image ConverterConvert images between JPG, PNG, WEBP, AVIF, BMP, GIF and ICO in batches, right in your browser.HEIC to PNGConvert iPhone HEIC and HEIF photos to lossless PNG in batches, with ZIP download.