Zero Signup ToolsFree browser tools

Developer Tools

CSS Color Extractor

Extract every color from CSS, HTML, or any text. Dedupes hex, rgb, hsl, oklch, and named colors into a sortable palette with counts and copy-ready formats.

1,143 chars

Extracted palette

Showing 20 of 20 unique colors.

Sort by
  • #2962ff
    rgb(41, 98, 255)hsl(224, 100%, 58%)oklch(0.562 0.24 264)
  • #f3f4f6
    rgb(243, 244, 246)hsl(220, 14%, 96%)oklch(0.967 0.003 265)
  • #00000073alpha 0.45first seen as rgba(0, 0, 0, 0.45)
    rgba(0, 0, 0, 0.45)hsla(0, 0%, 0%, 0.45)oklch(0 0 0 / 0.45)
  • #94a3b8first seen as rgb(148 163 184)
    rgb(148, 163, 184)hsl(215, 20%, 65%)oklch(0.711 0.035 257)
  • #ffffffwhitefirst seen as white
    rgb(255, 255, 255)hsl(0, 0%, 100%)oklch(1 0 90)
  • #fa59592ealpha 0.18first seen as oklab(0.68 0.18 0.08 / 0.18)
    rgba(250, 89, 89, 0.18)hsla(0, 94%, 66%, 0.18)oklch(0.679 0.197 24 / 0.18)
  • #dc143ccrimsonfirst seen as crimson
    rgb(220, 20, 60)hsl(348, 83%, 47%)oklch(0.571 0.222 20)
  • #ffffff14alpha 0.08first seen as rgba(255, 255, 255, 0.08)
    rgba(255, 255, 255, 0.08)hsla(0, 0%, 100%, 0.08)oklch(1 0 90 / 0.08)
  • #6f3ad9
    rgb(111, 58, 217)hsl(260, 68%, 54%)oklch(0.511 0.225 292)
  • #141459first seen as hwb(240 8% 65%)
    rgb(20, 20, 89)hsl(240, 63%, 21%)oklch(0.25 0.119 274)
  • #3fc1d7first seen as lch(72% 38 215)
    rgb(63, 193, 215)hsl(189, 66%, 55%)oklch(0.75 0.114 211)
  • #ee5453first seen as lab(58% 60 35)
    rgb(238, 84, 83)hsl(0, 82%, 63%)oklch(0.654 0.19 24)
  • #fbbf24
    rgb(251, 191, 36)hsl(43, 96%, 56%)oklch(0.837 0.164 84)
  • #34d39960alpha 0.38
    rgba(52, 211, 153, 0.376)hsla(158, 64%, 52%, 0.376)oklch(0.773 0.153 163 / 0.376)
  • #49556959alpha 0.35first seen as hsla(218, 18%, 35%, 0.35)
    rgba(73, 85, 105, 0.35)hsla(218, 18%, 35%, 0.35)oklch(0.447 0.036 261 / 0.35)
  • #ff6f69first seen as oklch(0.72 0.18 25)
    rgb(255, 111, 105)hsl(2, 100%, 71%)oklch(0.716 0.177 25)
  • #131a23
    rgb(19, 26, 35)hsl(214, 30%, 11%)oklch(0.215 0.021 255)
  • #0c1117
    rgb(12, 17, 23)hsl(213, 31%, 7%)oklch(0.175 0.015 253)
  • #8044dafirst seen as hsl(264 67% 56%)
    rgb(128, 68, 218)hsl(264, 67%, 56%)oklch(0.541 0.216 297)
  • #2962ff1falpha 0.12first seen as rgba(41, 98, 255, 0.12)
    rgba(41, 98, 255, 0.12)hsla(224, 100%, 58%, 0.12)oklch(0.562 0.24 264 / 0.12)

What gets recognised

Hex notation

Three, four, six, and eight digit hex codes:#fff,#fff8,#2962ff,#2962ff60.

RGB and HSL

Both legacy comma syntax and modern slash-alpha syntax:rgb(255, 0, 0),rgba(255 0 0 / 50%),hsl(180 50% 50%).

CSS Color 4

Newer color spaces are converted to sRGB for the swatch and kept in the output: hwb(), lab(), lch(), oklab(), oklch(), and color() (srgb, srgb-linear).

Named colors

The full CSS Color Module Level 4 keyword set, fromalicebluetoyellowgreen, plustransparent. Toggle off if your text contains color words used as plain English.

Comments are skipped

CSS/* ... */and JS-style//line comments are stripped before scanning, so commented-out colors do not pollute the palette.

Dedupe and recount

Spellings that resolve to the same sRGB triplet and alpha are merged into a single row. For example,#fff,#FFFFFF,rgb(255 255 255), andwhitecollapse to one entry whose count reflects every occurrence.

How to use

  1. Paste CSS, HTML, JSX, JSON, or any text into the input area. Click Load sample to try the extractor with an example theme file.
  2. Read the live stats card for total color references, unique colors, alpha colors, and the breakdown of hex, modern, and named formats.
  3. Scroll the extracted palette to see each unique color with a swatch, the canonical hex, RGB, HSL, and OKLCH values, the closest CSS named color, and how many times it appears.
  4. Use Sort by Count, Hex, Hue, or Lightness, and flip Descending or Ascending to reorder the table for the audit you are doing.
  5. Turn off Include CSS named colors when your input contains color words used as prose, so red and white in copy do not appear as palette entries.
  6. Click Copy hex, Copy RGB, or Copy OKLCH on any row, or grab the whole palette with Copy CSV or Copy CSS variables for design-token migration.

About this tool

CSS Color Extractor scans any text you paste, a stylesheet, an HTML page, a JSX file, a JSON theme file, even a code review comment, and pulls out every color it finds. It recognises hex codes in three, four, six, and eight digit forms, the legacy and modern syntax of rgb(), rgba(), hsl(), hsla(), plus the full CSS Color 4 functions hwb(), lab(), lch(), oklab(), oklch(), and color(). The complete CSS named-color list is matched too, so red, papayawhip, rebeccapurple, transparent, and the rest are caught. Every match is converted to a canonical sRGB triplet and an alpha value, then duplicates are merged: lowercase and uppercase spellings, three and six digit hex variants, and the named-color equivalent of the same triplet collapse into a single row with an accurate occurrence count. CSS block comments and JavaScript line comments are stripped before scanning so commented-out colors do not show up in the palette. Each row shows a live swatch (with a checkerboard background when there is transparency), the canonical hex, the rgb() and hsl() forms, the OKLCH equivalent (useful for modern design systems), and the closest CSS named color when one matches exactly. Sort by usage count to find the colors that drive the design, by hue to see the rainbow, by lightness to spot inconsistent grays, or by hex for a stable alphabetical view. Export the whole palette as CSV for spreadsheets, or as a ready-to-paste :root { --custom-property } block of CSS variables. Useful for auditing third-party CSS before integration, consolidating ad-hoc colors into a design token set, mapping legacy hex values to a Tailwind palette, generating swatch sheets for a brand review, checking how many alpha colors a stylesheet leans on, and any other task that begins with what colors does this code actually use. Everything runs in your browser; the text you paste, including any internal class names or production CSS, never leaves your device.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools