Color conversion

Need that HEX code as RGB? Convert it as you type.

Convert colors between HEX, RGB and HSL, or numbers between decimal, hex and binary. Press ⌘K, type #f0013d to rgb and press ↵.

7-day free trial No account Chrome, Edge, Brave, Arc, Vivaldi and Opera

Live demo

Convert a value in three steps

  1. ⌘K

    Step 1

    Open the palette

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

  2. #f0013d to rgb

    Step 2

    Type what you have

    The value, then to and the format you want.

  3. ↵

    Step 3

    Copy the result

    It’s on your clipboard, ready to paste.

In detail

What you can convert

Write the value, then to and the format you want. The result is written the way CSS expects it.

HEX, RGB and HSL

#f0013d to rgb gives rgb(240, 1, 61) and #f0013d to hsl gives hsl(344.94, 99.17%, 47.25%). It works the other way too: rgb(240, 1, 61) to hex gives #f0013d. Short codes like #0af are expanded for you.

  • Color names work: tomato to hex gives #ff6347.
  • Newer CSS formats are there too, such as oklch, lab, lch, hwb and p3.
  • A color with transparency becomes 8-digit HEX: rgba(240, 1, 61, 0.5) to hex gives #f0013d80.

Decimal, hex, octal and binary

255 to binary gives 0b11111111, 255 to hex gives 0xff and 64 to octal gives 0o100. To go back to decimal, write the number with its prefix: 0xff to decimal gives 255.

  • The 0x, 0b and 0o prefixes are read for you.
  • Negative numbers keep their sign: -255 to hex gives -0xff.
  • Very large numbers keep every digit, so 64-bit values convert exactly.

Take a color from the page first

Don’t have the code yet? Type :cp to open the Color Picker, click anywhere on the page and the HEX code is copied. Then open the palette again and convert it to RGB or HSL.

  • The picker shows the HEX and RGB value under your cursor as you move.
  • Press Esc to close it without picking.

More reasons to convert colors here

  • Enter copies the value

    A toast shows what you copied, such as Copied rgb(240, 1, 61).

  • Ready to paste into CSS

    Results come out as rgb(...), hsl(...) or #hex, so they go straight into a stylesheet.

  • At the top of the list

    The answer shows above your tabs, so it’s the row that’s already selected.

  • Works offline

    Conversions run inside the extension. Nothing you type is sent anywhere.

  • px to rem as well

    24px to rem gives 1.5rem, for the other numbers you copy between design and code.

  • Math in the same box

    Sums, percentages and unit conversions are answered the same way.

FAQ

Questions about color conversion

More in the documentation.

How do I convert HEX to RGB in Chrome?

Press ⌘K on a Mac or Ctrl+K on Windows and Linux and type the code with to rgb, like #f0013d to rgb. The result shows at the top. Press Enter to copy it.

How do I convert RGB to HEX?

Type the color the way CSS writes it, then to hex: rgb(240, 1, 61) to hex gives #f0013d.

Can it convert to HSL or OKLCH?

Yes. Use to hsl or to oklch. lab, lch, hwb, p3 and rgba work too.

How do I convert a number to binary or hex?

Type 255 to binary, 255 to hex or 255 to octal. You get 0b11111111, 0xff or 0o377.

How do I convert hex to decimal?

Type 0xff to decimal. A hex number with a letter in it also works without the prefix, like ff to decimal.

Does it work offline?

Yes. Colors and numbers are converted inside the extension, with no network request.

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

Free for 7 days Then $3.99 / y No account