How-to guide

How to convert color codes for CSS

Press ⌘K with TabCmdr and type a color and the format you want, like rgb(26, 115, 232) to hex or #1a73e8 to oklch. Enter copies the CSS value.

Quick answer

Convert a color in three steps

  1. ⌘K

    Step 1

    Open the palette

    Ctrl+K on Windows and Linux. Works on any page.

  2. tomato to hex

    Step 2

    Type the color and format

    The converted color shows at the top of the list.

  3. ↵

    Step 3

    Press Enter

    The value is copied, ready to paste into your CSS.

Chrome's way

Use Google’s color picker

Google Search has a color picker. Type a color code into the search box on google.com, like rgb 255 255 255 or #f0f0f0, or search for color picker to open it. It reads Hex, RGB and Pantone codes and shows the color as Hex, RGB, HSV, HSL and CMYK.

You can search from Chrome’s address bar too. If Google is your default search engine, type the color code there and press Enter. In some countries Google is Chrome’s default, and in others Chrome asks you to pick one.

Sources: Google’s calculator, unit converter and color codes and default search engine help pages, checked in October 2026.

TabCmdr's way

Convert colors in the TabCmdr palette

TabCmdr is a keyboard launcher that lives in your browser. Its search box converts colors into the formats you write in CSS, including newer ones like OKLCH and Display P3.

Before you start: add TabCmdr from the Chrome Web Store. It has a 7-day free trial and needs no account.

Step 1: Open the palette

Press ⌘+K on a Mac or Ctrl+K on Windows and Linux, on any page.

Step 2: Type the color, then to and the format

The answer shows under Calculator at the top of the list.

TabCmdr palette with rgb(26, 115, 232) to hex typed and the answer #1a73e8 under Calculator
rgb(26, 115, 232) to hex gives #1a73e8.

You can start from almost any way of writing a color:

  • HEX with or without the #, like #1a73e8 or 1a73e8, and short codes like #0af, which gives rgb(0, 170, 255).
  • CSS functions like rgb(26, 115, 232), rgba(240, 1, 61, 0.5) or hsl(217, 82%, 51%).
  • Three plain numbers for red, green and blue, like 26 115 232.
  • CSS color names, like tomato or rebeccapurple.
TabCmdr palette with tomato to hex typed and the answer #ff6347 under Calculator
Color names work too: tomato to hex gives #ff6347.

Step 3: Press Enter to copy

The answer row is already highlighted. Press Enter and TabCmdr copies the value and closes the palette. A “Copied #1a73e8” message shows at the bottom of the page. Long values, like OKLCH or Lab, can be cut short on screen, but Enter always copies the whole value.

Formats you can convert to

Here’s #1a73e8 in each common format:

You typeYou get
#1a73e8 to rgbrgb(26, 115, 232)
#1a73e8 to rgbargba(26, 115, 232, 1)
#1a73e8 to hslhsl(214.08, 81.75%, 50.59%)
#1a73e8 to hex8#1a73e8ff
#1a73e8 to oklchoklch(0.573697468129 0.194602948853 257.857761126)
#1a73e8 to lablab(48.7749556744 9.68722690445 -67.4701979581)
#1a73e8 to p3color(display-p3 0.217826055877 0.444343039479 0.879437765126)

TabCmdr also converts to hwb, lch, oklab, rec2020, a98, prophoto, xyz50 and xyz65. A color with transparency keeps it: rgba(240, 1, 61, 0.5) to hex gives #f0013d80.

If no answer shows up

  • The format isn’t a CSS one. CMYK, HSV and Pantone aren’t supported, so #1a73e8 to cmyk gives no answer. Use Google’s color picker for those.
  • The color code is incomplete. A HEX color needs 3, 4, 6 or 8 digits.
  • You need a color from the page itself. The color picker grabs any color on screen.

Try it on your own tabs

Works in Chrome, Edge, Brave, Arc, Vivaldi and Opera.

Install for Chrome

FAQ

Questions about converting colors

More in the documentation.

How do I convert RGB to HEX?

Type the color and to hex, like rgb(26, 115, 232) to hex, which gives #1a73e8. Three plain numbers work too: 26 115 232 to hex.

Can I convert a HEX color to OKLCH or Display P3?

Yes. #1a73e8 to oklch gives oklch(0.573697468129 0.194602948853 257.857761126), and #1a73e8 to p3 gives a color(display-p3 …) value. Press Enter to copy the full value.

What happens to transparency?

It’s kept. rgba(240, 1, 61, 0.5) to hex gives the 8-digit HEX #f0013d80.

Does it convert to CMYK, HSV or Pantone?

No. TabCmdr sticks to color formats you can use in CSS. Google’s color picker converts to CMYK and HSV, and reads Pantone codes.

Can I type a color name?

Yes. CSS color names work, so tomato to hex gives #ff6347 and rebeccapurple to rgb gives rgb(102, 51, 153).

One shortcut for your whole browser. Stop hunting for tabs.

Free for 7 days Then $3.99 / y No account