Hex Color Extractor

Pull every hex color code out of CSS or text and count each unique value.

  • No sign-up
  • Files stay local. Nothing is sent to our servers.
  • Nothing uploaded
  • Free forever

Drop text files here

.css, .txt, .html, .csv, .tsv, .xlsx, .xls, .xml, .json, .log · local only · up to 1000 MB total · Excel up to 256 MB

The Hex Color Extractor scans any block of CSS, code, or plain text and collects every hexadecimal color code it can find, then presents them as a tidy table with a usage count beside each unique value. Instead of scrolling through a stylesheet hunting for color declarations, you get an instant inventory of exactly which colors a file uses and how often each one appears.

It recognises the three common hex notations: the short three-digit form such as #fff, the standard six-digit form such as #ff8800, and the eight-digit form that includes an alpha channel such as #ff8800cc. Matching is boundary aware, so partial strings and IDs that merely look like hex are ignored, leaving you with genuine color values rather than false positives.

Everything runs locally in your browser using JavaScript, so nothing you paste is uploaded or stored anywhere. Designers, front-end developers, and anyone auditing a theme can drop in a stylesheet, review the extracted palette, and export the list, all while keeping proprietary code entirely on their own machine.

Features of Hex Color Extractor

  • Detects three-digit, six-digit and eight-digit hex color codes, covering shorthand, full and alpha-channel notations.
  • Uses word-boundary matching so unrelated hex-like strings are far less likely to be picked up by mistake.
  • Counts how many times each unique color appears, revealing the dominant colors in a stylesheet at a glance.
  • Optionally lowercases every code so that mixed-case values such as #FFF and #fff are treated as one color.
  • Sorts the results by frequency so the most-used colors surface at the top of the extracted palette.
  • Reports total matches and the number of distinct colors, giving a quick measure of palette complexity.
  • Exports the color table to CSV or XLSX, or copies it to the clipboard for pasting into design docs.

How to use Hex Color Extractor

  1. Paste your CSS, code, or any text containing hex color codes into the input box.
  2. Leave the lowercase option enabled to merge case variants, or turn it off to keep original casing.
  3. Read the table, where each row shows a unique hex color alongside the number of times it appears.
  4. Check the stats to see the total number of color codes found and how many are distinct.
  5. Identify overused or near-duplicate colors that could be consolidated into a smaller palette.
  6. Export the table to CSV or XLSX, or copy it, to document the palette or feed it into other tools.

Benefits of Hex Color Extractor

  • Front-end developers audit a stylesheet to understand its true color palette before a refactor.
  • Designers extract the working colors from a prototype or theme to build a formal palette.
  • Teams spot near-duplicate colors that should be unified into shared design tokens or variables.
  • Anyone reviewing inherited code gets an instant overview of the colors a project actually uses.
  • Accessibility reviewers gather every color in play as a first step toward contrast checking.
  • Because processing is local, proprietary stylesheets and brand colors never leave your device.

Hex colors are the most common way to specify colors in CSS and many design tools. A leading hash is followed by three, six, or eight hexadecimal digits: three-digit codes are a shorthand that doubles each digit, six-digit codes give full red-green-blue precision, and eight-digit codes add an alpha channel for transparency. This tool understands all three so your inventory is complete regardless of which notation a file prefers.

The usage count is often more useful than the raw list. A color that appears dozens of times is likely a core brand or theme color, while one that appears a single time may be an accidental one-off or a candidate for consolidation. Sorting by frequency makes these patterns obvious, which is invaluable when you are trying to shrink a sprawling palette into a manageable set of design tokens.

All extraction happens in your browser with JavaScript, so nothing you paste is transmitted or saved, making the tool safe for confidential or unreleased code. Keep in mind that it only recognises hexadecimal notation, so named colors, rgb() and hsl() functions are not included; if your stylesheet mixes formats, treat this as a hex-specific audit rather than a full color census.

Questions about Hex Color Extractor

Which hex formats are detected?
It recognises three-digit shorthand such as #fff, standard six-digit codes such as #ff8800, and eight-digit codes that include an alpha channel such as #ff8800cc. All three are collected together, deduplicated, and counted in a single pass.
Does it find rgb() or named colors too?
No. This tool focuses specifically on hexadecimal color codes. Functional notations like rgb() and hsl(), and named colors such as red or navy, are not matched, so treat the output as a hex-only inventory of your input.
Why does it count each color?
The count shows how many times each unique color appears in the input. Frequently used colors are usually core theme colors, while rarely used ones may be one-offs or candidates for consolidation, so the count helps you understand and simplify a palette.
What does the lowercase option do?
When enabled, every code is converted to lowercase before counting, so #FFF and #fff are treated as the same color. Turn it off if you want to preserve the exact casing used in the source and see case variants separately.
Is my code uploaded anywhere?
No. All scanning and counting happens locally in your browser using JavaScript. Nothing you paste is uploaded or stored, so the tool is safe to use with proprietary stylesheets and unreleased brand colors.
How your data is handled: This tool runs entirely in your browser. Nothing is uploaded or stored on our servers.

More extraction tools to try