Skip to content

HEX Color Validator

Check whether a colour code is valid, and fix it if not.

The codes to check

Cleaned list
The normalised codes appear here

Quick Tool Overview

The HEX Color Validator checks colour codes in bulk, says what specifically is wrong with the invalid ones, normalises the valid ones to a single convention, and flags the same colour written four different ways.

What it does
Validates and normalises HEX colour codes
You give it
One code, a list, or a whole stylesheet
You get back
Valid, invalid with reasons, and a clean list
Best for
Auditing a stylesheet or a design handoff
Color Tools Free, unlimited use No sign-up Runs in your browser

About the HEX Color Validator

Paste one colour or a thousand and this tells you which are valid, what is wrong with the ones that are not, and what the corrected version should be. It is a small thing until you are auditing a stylesheet someone else wrote.

Every valid form is recognised: three, four, six and eight digits, with or without the hash. So are the ones that are almost valid — five digits, a stray character, a letter beyond F, a missing hash, a 0x prefix from another language — each reported with what specifically went wrong rather than a flat rejection.

The normalisation is the useful part for a codebase. A mixed file can be brought to one convention: lowercase or uppercase, shorthand expanded or contracted where it is safe, hash always present. The tool also flags duplicates — the same colour written four different ways is a real and common finding — and can show what each valid colour actually looks like, which is usually when someone notices the typo that has been shipping for a year.

Key features of the HEX Color Validator

Specific reasons

Five digits, a letter beyond F, a missing hash, a 0x prefix — each named rather than flatly rejected.

Every valid form

Three, four, six and eight digits are all recognised, including the alpha shorthand.

Normalisation

Bring a mixed file to one convention: case, shorthand and hash, applied consistently.

Duplicates flagged

The same colour written four ways in one stylesheet is a real and common finding.

Every code shown as a swatch

Which is usually when someone spots the valid typo that has been shipping for a year.

How to use the HEX Color Validator

  1. 1

    Paste your colours

    One per line, or a whole stylesheet — the codes are found in it.

  2. 2

    Read the results

    Valid, invalid with a reason, and the suggested correction.

  3. 3

    Choose a convention

    Lowercase or uppercase, shorthand or full length.

  4. 4

    Copy the cleaned list

    Normalised, with duplicates flagged.

Frequently asked questions

A hash followed by exactly 3, 4, 6 or 8 hexadecimal digits — 0 to 9 and A to F. Anything else is invalid: five digits, a letter beyond F, or a stray space inside the code.

Reviews of the HEX Color Validator

What people who use the HEX Color Validator think of it. Reviews come from visitors and are posted as written.

No ratings yet

Yours would be the first.

  • 5 0 reviews rated 5 stars
  • 4 0 reviews rated 4 stars
  • 3 0 reviews rated 3 stars
  • 2 0 reviews rated 2 stars
  • 1 0 reviews rated 1 star

Write a review

Used this tool? Your rating helps the next person decide.

Your rating

Plain text only — links, email addresses and HTML are not accepted. Your name and review are shown publicly; nothing else is collected. See the privacy policy.

0 reviews

Newest first

No reviews yet

Be the first to rate the HEX Color Validator. It takes half a minute and no account.

Write the first review

More color tools