How to convert a colour
- Enter a colour in the box, for example
#6366F1,rgb(99 102 241),hsl(239 84% 67%)or a name liketeal. You can also press Pick a colour to use your device's colour picker. - Check the preview. A large swatch shows the colour with sample text in white and in black on top of it.
- Copy the format you need. The Formats list shows HEX, RGB, HSL and OKLCH, each with its own copy button.
- Check the contrast. The Text contrast panel shows the ratio against white and against black, and the highest WCAG level the colour reaches.
Features
- Four output formats at once: HEX, RGB, HSL and OKLCH, ready to paste into CSS.
- Flexible input: 3, 4, 6 and 8-digit HEX,
rgb(),hsl(),oklch(), modern and legacy syntax, and CSS colour names. - Transparency support, with alpha shown in every format.
- Native colour picker on phones and computers.
- WCAG 2 contrast ratio on white and on black, labelled AAA, AA, AA Large or Fails AA.
- Live preview swatch with sample text in both white and black.
- Friendly error message with examples when a value can't be read.
Why use Fileora's colour converter
It does the maths in your browser, so there is nothing to wait for and nothing is sent anywhere, including unreleased brand colours. It's free, has no sign-up, and it works on a phone, which helps when you are matching a colour you have just seen on screen.
Pairing a colour conversion with a contrast check saves a step: you find out whether a brand colour is safe for buttons and links before it reaches a design review.
HEX, RGB, HSL and OKLCH compared
HEX is the most compact and the most widely supported format. #6366F1 is simply the red, green and blue values written in base 16. It is ideal for design handoffs but hard to adjust by eye.
RGB holds the same information as whole numbers from 0 to 255. It is useful when a colour comes from code, such as a canvas or an image library.
HSL splits a colour into hue, saturation and lightness, so you can make a colour lighter without changing its hue. Its weakness is that lightness is not perceptual: yellow at 50% lightness looks far brighter than blue at 50%.
OKLCH fixes that. Its lightness follows human vision, so you can build a scale of shades where each step looks evenly spaced, or swap hues while keeping text contrast similar. For design tokens and themes it is usually the best choice, with HEX kept as a fallback for older tools.
Getting contrast right
Aim for at least 4.5:1 for body text and 3:1 for large headings and icons. Mid-tones often pass on one background but fail on the other, so check both white and black if your site has a dark mode. If a brand colour fails, lower its OKLCH lightness a little for text and keep the original for backgrounds and borders.
When you need to embed a small icon in that colour directly in your CSS, the image to Base64 converter turns it into a data URI. You can also turn a colour-coded link into a scannable code with the QR code generator, and keep theme files tidy with the JSON formatter.