All Over Tools logo
Tool Combiner
Analyze Tools Clean Tools Compare Tools Convert Tools Data Validation Extract Tools Format Tools Generate Tools Organize Tools Transform Tools
Image Tools Video Tools Audio Tools Subtitle Tools Font Tools
Analyze Tools Clean Tools Compress Tools Convert Tools Edit Tools Extract Tools Generate Tools Merge Tools Organize Tools Redact Tools Repair Tools Split Tools
Analyze Tools Clean Tools Compare Tools Convert Tools Extract Tools Generate Tools Merge Tools Transform Tools Validate Tools
Business Calculators Construction Calculators Date And Time Calculators Education Calculators Financial Calculators Food Calculators Health Calculators Math Calculators Science Calculators Sports Calculators Statistics Calculators
Blog About Us Contact Us

Hex Color Code Extractor

Paste any text or CSS and instantly find every hex color literal it contains - #RGB, #RGBA, #RRGGBB, and #RRGGBBAA. Each match keeps its detected format, source line, and surrounding context.

What the tool recognizes

The extractor searches the supplied text for four patterns: #RGB, #RGBA, #RRGGBB, and #RRGGBBAA. It performs text matching; it does not validate CSS usage, convert colors, or calculate contrast.

A match is rejected when its # is preceded by another # or a hexadecimal digit. It is also rejected when another hexadecimal digit follows the matched length, so the tool does not take a partial match from a longer hexadecimal run.

How to extract color codes

  1. Paste text into the input area.
  2. To load one file, select Upload or use Drop file. The Upload picker lists .txt, .css, .html, .json, and .log.
  3. Review the count and results table. The count shows the number of extracted entries.
  4. Adjust Unique only or Normalize case (lowercase) if needed.
  5. Use Copy or Download to export the extracted list.

The tool processes one text value or one uploaded file at a time. If there are no matches, the count remains 0 colors found and the results panel stays hidden.

Controls and output

  • Unique only is enabled by default. It keeps the first occurrence of each case-insensitive value.
  • Normalize case (lowercase) lowercases the matched hex digits without expanding #RGB or #RGBA shorthand.
  • The results table shows Match, Format, Line, and a shortened Context snippet.
  • The output textarea contains only the extracted color list. Copy and Download export that list, not the table metadata.

Limitations and browser behavior

The matching step runs in the browser. The page also includes external analytics scripts, so this does not establish that the whole page makes no network requests.

The local implementation does not state a maximum input or file size. It also does not document error messages for unsupported files, failed clipboard writes, or empty exports. Copy and Download do nothing when the extracted list is empty. Clipboard support and the regex lookbehind used by the extractor are not confirmed for every browser environment.

Frequently asked questions

Which hex color formats does this tool recognize?

It recognizes #RGB, #RGBA, #RRGGBB, and #RRGGBBAA.

Does this tool convert hex colors to RGB or check contrast?

No. It finds and lists matching hex color text. It does not convert colors or calculate contrast ratios.

How does normalization work?

Enable Normalize case (lowercase) to lowercase the matched hex digits while keeping the original 3-, 4-, 6-, or 8-digit length. It does not expand shorthand.

What does Unique only do?

Unique only starts enabled. It keeps the first occurrence of each case-insensitive hex value and removes later duplicates.

Which file types can I upload?

The Upload picker lists .txt, .css, .html, .json, and .log files. One uploaded file is processed at a time.

What do Copy and Download export?

Copy and Download export only the extracted color list. They do not include the results table's format, line, or context fields.

Related Tools

2 views