RGB to HEX Converter
Turn an RGB value (59, 130, 246) into a HEX color code (#3B82F6). The forms without # and with alpha are listed too, ready to copy.
Your input stays in your browser and is never sent.
Enter three numbers from 0 to 255 for R, G and B, such as 59, 130, 246 or rgb(59, 130, 246).
Converting this color
Click to copy. In PowerPoint's RGB fields, use the form without # or brackets.
What the RGB to HEX converter does
It turns an RGB color (red, green and blue as numbers from 0 to 255, such as 59, 130, 246) into the hex color code #3B82F6. Numbers you read off PowerPoint's or Excel's color dialog, or from a design brief, become a code you can use on the web or in Canva.
Paste all three numbers at once, or use "Pick a color" to choose one. A preview of the color and the hex code appear immediately. Values with opacity (RGBA) are converted to eight-character hex as well.
Convert RGB to a hex code in three steps
- EnterPaste your RGB value into the box. 59, 130, 246 and rgb(59, 130, 246) both work. If you don't have the numbers, choose a color with "Pick a color".
- See the resultCheck the color preview to make sure it is the color you meant. "Converted to HEX" lists HEX, HEX (no #), RGB and more.
- CopyClick the HEX or HEX (no #) row to copy it, then paste it where you need it.
How RGB to hexadecimal conversion works
A hex color code is the red, green and blue numbers each written as two hexadecimal digits and joined in that order. Hexadecimal uses A to F for the values 10 to 15, so two digits cover everything from 0 (00) to 255 (FF).
For RGB (59, 130, 246): 59 ÷ 16 is 3 remainder 11, giving 3B; 130 ÷ 16 is 8 remainder 2, giving 82; 246 ÷ 16 is 15 remainder 6, giving F6. Joined, that is #3B82F6. A value below 16 gets a leading zero so it still takes two digits, as in 0A.
Pasting the hex code into Canva, CSS or PowerPoint
Canva, Figma and CSS accept #3B82F6 with the hash as it is. The custom color field in PowerPoint, Word and Excel, on the other hand, accepts six characters only and rejects a leading hash.
That is why the result lists HEX and HEX (no #) as separate rows, so there is nothing to delete before you paste.
Convert RGBA to an eight-character hex code
Enter a value with opacity, such as rgba(59, 130, 246, 0.5), and besides the six-character code you get #3B82F680 on the HEX (with alpha) row, with the opacity added as two more characters. Half of 255 rounds to 128, which is 80 in hexadecimal.
Eight-character hex works in CSS, but some apps accept six characters only. In PowerPoint, set the color with the six-character code and the opacity with the Transparency slider in the color dialog.
Converting a hex code back to RGB, or getting HSL too
For the reverse direction, use the HEX to RGB Converter. To see HSL as well, use the Color Code Converter (HEX, RGB, HSL). Both are linked under "Other conversions" on this page.
RGB to HEX converter FAQ
- How do you convert RGB to HEX by hand?
- Write each of the three numbers as two hexadecimal digits and join them in red, green, blue order. 59 is 3 × 16 + 11, and 11 is B in hexadecimal, so it becomes 3B; 130 becomes 82 and 246 becomes F6. RGB (59, 130, 246) is therefore #3B82F6. Hexadecimal uses the letters A to F for the values 10 to 15.
- Can I turn the RGB numbers from PowerPoint into a hex code for Canva?
- Yes. Paste the red, green and blue values from PowerPoint's color dialog into the box together, as in 59, 130, 246. Click the HEX row to copy it, then paste it into Canva's color field.
- Does it convert RGBA to HEX?
- Yes. Paste rgba(59, 130, 246, 0.5) and you also get the eight-character #3B82F680, where the last two characters are the opacity. CSS accepts eight-character hex, but PowerPoint's color dialog takes six characters and sets opacity with a separate Transparency slider.
- How do I convert a hex code back to RGB?
- Use the HEX to RGB Converter. Paste a code such as #3B82F6 and it gives you rgb(59, 130, 246) plus the red, green and blue numbers on rows of their own. If you want HSL as well, use the Color Code Converter.
- Is the color I enter sent anywhere?
- No. The conversion runs entirely in your browser and the value never leaves it. There is no sign-up and no daily limit either.
Related tools
- Color Code Converter (HEX, RGB, HSL)Convert a color code between HEX, RGB and HSL in any direction. Every form is listed side by side, including the one PowerPoint accepts.
- HEX to RGB ConverterTurn a HEX color code (#3B82F6) into RGB (59, 130, 246). The R, G and B numbers PowerPoint asks for can each be copied on their own.
- JPG to PDF ConverterCombine JPG images into one PDF. Reorder pages and pick the page size and margin. Free, no sign-up, and your images are never uploaded.
- PNG to PDF ConverterCombine PNG images, such as screenshots and diagrams, into one PDF in the order you choose. Free, no sign-up, and your images are never uploaded.
- WebP to PDF ConverterCombine WebP images, including ones saved from the web, into one PDF. Free, no sign-up, and your images are never uploaded.
- Image to PDF ConverterCombine JPG, PNG, WebP, GIF and BMP images, even mixed together, into one PDF. Free, no sign-up, and your images are never uploaded.
- HEIC to JPG/PNG/WebP ConverterConvert iPhone HEIC photos to JPG, PNG, or WebP. Batch conversion with quality control.
- SVG to PNG ConverterConvert SVG files to PNG for free at 1x, 2x or 4x. Transparency is preserved, so logos and icons stay usable over any background.
- SVG to JPG ConverterConvert SVG files to JPG or JPEG for free. JPG cannot hold transparency, so you choose the background color and the export scale.
- WebP ConverterConvert images to WebP or WebP to JPG/PNG. Reduce file size with modern web-optimized format.
- PNG ⇔ JPG ConverterConvert between PNG and JPG formats. Adjust quality and handle transparent backgrounds.
- Bulk Image ConverterConvert a mixed folder of PNG, JPG and WebP files to one format at once, with optional resizing and a single ZIP download.