Color Format Converter
One colour, every notation — HEX, RGB, HSL, HWB, LAB, LCH and OKLCH.
Check whether a colour code is valid, and fix it if not.
The normalised codes appear here
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.
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.
Five digits, a letter beyond F, a missing hash, a 0x prefix — each named rather than flatly rejected.
Three, four, six and eight digits are all recognised, including the alpha shorthand.
Bring a mixed file to one convention: case, shorthand and hash, applied consistently.
The same colour written four ways in one stylesheet is a real and common finding.
Which is usually when someone spots the valid typo that has been shipping for a year.
One per line, or a whole stylesheet — the codes are found in it.
Valid, invalid with a reason, and the suggested correction.
Lowercase or uppercase, shorthand or full length.
Normalised, with duplicates flagged.
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.
In CSS, yes. Without it the value is not a colour and the declaration is discarded. Many other contexts accept a bare code, which is why it is such a common omission.
Shorthand for eight digits, where each digit is doubled and the fourth is alpha. #f80c expands to #ff8800cc. It is valid CSS and supported everywhere.
Usually a transposition — #f0f8ff typed as #f08fff is perfectly valid and a completely different colour. That is why every result here is shown as a swatch rather than just marked as valid.
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.
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 reviewOne colour, every notation — HEX, RGB, HSL, HWB, LAB, LCH and OKLCH.
Turn a HEX code into SwiftUI Color, UIColor and NSColor code.
See your colours as the eight percent of men who see them differently do.
Interpolate an even scale between two or more colours.
The 216 web-safe colours, and why they no longer matter.
Pick a colour from anywhere on your screen.
Generate random colours you would actually use.
All 148 CSS colour names, searchable and sortable.