Your brand guide says the blue is #1F6F8B, but the web developer wants RGB and the print shop wants CMYK. Type the color once here and copy each code in the form that person needs.
How to use the converter
- Type or paste your color in the big field. A HEX code like #EFBF04 works, and so do rgb(239, 191, 4), hsl(48, 97%, 48%) and names like tomato.
- Or tap the swatch to pick a color with your device's own color picker.
- Every format updates as you type. Press Copy next to the one you need.
- Want to go the other way? Type in any row. Type RGB numbers in the RGB row and the HEX code shows up at the top.
- Reset takes you back to the start color.
Copy as gives the plain RGB numbers (239, 191, 4) that some apps want in their color fields, a CSS variable or a Tailwind class. Copy link to this color copies a link that opens the converter with your color, so you can send it to a designer.
Have a whole brand palette? Open Convert a list of colors, paste one color per line (or several on a line with commas between them), and copy all of them as CSV for a spreadsheet. Up to 200 colors at once.
Why one color has so many codes
A screen makes every color from red, green and blue light. HEX and RGB write down the same three amounts in two ways. HEX uses a # and two digits in base 16 for each one, from 00 to FF, so #1F6F8B is 1F red, 6F green and 8B blue. RGB writes them as plain numbers from 0 to 255: rgb(31, 111, 139). #F80 is short for #FF8800, and two more digits at the end add see-through: #1F6F8B80 is half see-through.
The other formats came later, each for a different job:
- HSL is hue (the color on the color wheel, 0 to 360), saturation and lightness. It is the easy one to change by hand: lower the lightness for a darker shade of the same color.
- HSV, also called HSB, is a mode the color pickers in Photoshop and Figma offer. It is not used in CSS.
- CMYK is cyan, magenta, yellow and black ink, for print.
- OKLCH is newer CSS. Its steps in lightness look even to the eye, which helps when you make a row of shades.
- Name is the CSS name of a color, like tomato or steelblue. CSS has 148 of them.
Where a wrong code bites
Most color mix-ups are small and easy to miss. Paste 1F6F8B into a field that wants RGB numbers and you get an error, or a different color. Change one digit, #1F6F8B to #1F6F5B, and this week's posts are a shade off from last week's. One post alone looks fine, but nine side by side on your profile grid show it.
Print is the other trap. Ink cannot make every color a screen can, so bright blues and greens often print duller than they look on screen. A logo blue copied from a screen formula can come back from the printer flat and gray.
What the converter does and does not do
It reads HEX with 3, 4, 6 or 8 digits, rgb() and rgba(), hsl(), hsv() or hsb(), cmyk(), oklch(), bare numbers and the 148 CSS names. HEX to RGB is exact, since they are the same numbers. HSL, HSV and CMYK come from the RGB numbers with the standard formulas, rounded to whole numbers as design apps show them. Going back from rounded numbers can move a color by a few steps. The difference is too small to see, but for the exact color, copy the HEX code. When a color has no exact CSS name, the converter shows the closest one and says it is not the same color.
It does not give you print-ready CMYK. Those numbers are an estimate from a plain formula. A print shop turns colors into ink with a profile for its own paper and printer, so ask them for the final numbers. It does not check whether text is easy to read on a color: the contrast checker does that. And it does not keep or send your colors. Everything happens in your browser.
On social media
On social media your colors live in what you make: the text and shapes in your pictures, your profile picture and banner, and your link in bio page. Paste the HEX code into Canva or Postfjord's design editor so every post uses the exact same brand color. For text on a colored background, check it in the contrast checker too, since posts are often read on a phone in the sun.
Looking up a named color? The color code pages list the HEX, RGB and CMYK of gold, navy blue, sage green and more.
FAQ
How do I convert HEX to RGB?
Paste the HEX code into the converter and read the RGB row. By hand, split the code into three pairs and turn each pair from base 16 into a number: #EFBF04 is EF, BF and 04, which is 239, 191 and 4.
How do I convert RGB to HEX?
Type the three numbers in the RGB row, like 239, 191, 4, and the HEX code shows at the top. Each number becomes two digits from 00 to FF.
What is the difference between HEX and RGB?
Nothing in the color itself. HEX writes the red, green and blue numbers in base 16 after a #, and RGB writes them as plain numbers from 0 to 255.
Why do my CMYK colors look different when printed?
Screens make color with light and printers with ink, and ink cannot make every screen color. Bright blues and greens often print duller. The CMYK numbers here are an estimate, so ask your print shop for a proof.
What is OKLCH used for?
OKLCH is a newer way to write colors in CSS. Equal steps in its lightness look like equal steps to the eye, so it is handy for making a row of shades from one brand color.
Does the converter save my colors?
No. It runs in your browser and sends nothing to Postfjord. When you change the color, it is kept in the page's address so a link can bring it back, and nothing else is.