Pricing
Home/Free tools/Color converter
Updated November 24, 2026

Color converter

One color as HEX, RGB, HSL, OKLCH and OKLab, ready to copy

  • Free, no account needed
  • Runs in your browser: nothing you type is sent anywhere

HEX, rgb(), hsl(), oklch() or oklab(), for example #1f6feb

Preview
HEX
#1f6feb
RGB
rgb(31, 111, 235)
HSL
hsl(216.5, 83.6%, 52.2%)
OKLCH
oklch(56.86% 0.202 259.67)
OKLab
oklab(56.86% -0.036 -0.199)

Values are rounded: whole numbers for RGB, one decimal for HSL, two for OKLCH lightness and hue, three for chroma and OKLab.

Five ways to write one color

HEX and RGB are the same three numbers for red, green and blue, once in base 16 and once in decimal. HSL rearranges those sRGB values into hue, saturation and lightness, which is easier to adjust by hand, but its lightness does not match what the eye sees: yellow and blue at 50% lightness look very different.

OKLab and OKLCH, published by Björn Ottosson in 2020, are built so that equal steps look like equal changes. OKLCH describes a color by lightness (L), chroma (C, how colorful) and hue (h, an angle from 0 to 360). Both are part of CSS Color Module Level 4, written as oklab() and oklch().

How the conversion works

Each sRGB channel is divided by 255 and converted to linear light. Ottosson’s first matrix turns linear RGB into cone responses, which are cube-rooted, and his second matrix gives OKLab. OKLCH is OKLab in polar form: chroma is the distance from grey and hue is the angle.

Going back runs the same steps in reverse. If an OKLCH or OKLab color lands outside sRGB, this tool lowers its chroma until it fits, keeping lightness and hue, and says so.

#1f6feb → R 31, G 111, B 235
÷ 255, linearized → 0.0137, 0.1590, 0.8308
OKLab → L 0.5686, a −0.0363, b −0.1990

C = √(a² + b²) = 0.2023
h = atan2(b, a) = 259.67°
→ oklch(56.86% 0.202 259.67)

OKLCH in design systems

Because OKLCH lightness tracks what people see, it makes tint and shade scales predictable: keep chroma and hue, step the lightness, and every step looks evenly spaced. The same works for building a dark theme from a light one.

OKLCH can describe colors that sRGB cannot, such as the more saturated colors of Display P3 screens. Keep a HEX or rgb() fallback for anything that has to look the same everywhere, and hand colors to developers in the format the codebase already uses.

  • Adjust lightness in OKLCH rather than HSL when you need a lighter or darker version of a brand color
  • Check text and background pairs with a contrast checker after changing lightness
  • Write the source value next to converted ones in a style guide, so rounding never drifts across handovers

A tool by Lyniti

Colors, files and feedback in one project

Lyniti connects briefs, visual files, client feedback, approvals, schedules and billing by project, so a palette and the decisions behind it are easy to find again.

See Lyniti for design studios →

Related tools

All free tools →
  • Color contrast checker→Contrast ratio of two colors, checked against WCAG AA and AAA
  • Color palette generator→Harmonies and a 50–950 scale from one color, or the main colors of an image
  • CSS gradient generator→Linear, radial and conic gradients from color stops, as CSS to copy

Embed this tool

Add it to your own site or help centre. It runs in your visitors’ browsers, like here, and links back to this page.

<iframe src="https://lyniti.com/tools/color-converter/embed" title="Color converter" width="100%" height="760" style="border:0;max-width:100%" loading="lazy"></iframe>

Frequently asked

questions

How do I convert HEX to RGB?

Split the six digits into three pairs and read each pair as a base-16 number. #1f6feb becomes 1f = 31, 6f = 111 and eb = 235, so rgb(31, 111, 235). A three-digit HEX such as #36c doubles each digit first: #3366cc.

What do the three OKLCH numbers mean?

L is perceived lightness from 0% (black) to 100% (white), C is chroma, how colorful the color is (0 is grey), and h is the hue angle in degrees. oklch(56.86% 0.202 259.67) is a mid-light, strongly colored blue.

Why does a color say it is outside sRGB?

OKLCH and OKLab can describe colors more saturated than sRGB can hold. This converter keeps the original value for oklch() and oklab() and gives the nearest sRGB color for HEX, RGB and HSL by lowering chroma.

Can I use oklch() in CSS today?

Current versions of Chrome, Edge, Firefox and Safari support oklch() and oklab(). If you also support older browsers, declare a HEX or rgb() value first and the oklch() value after it.

Projects, clients and finance in one workspace

Lyniti helps agencies, consultancies, studios, and service teams manage projects, clients, approvals, invoices, bookkeeping, and finance in one workspace.

See it in actionSee it in actionSee Pricing

The all-in-one business collaboration platform that replaces multiple tools, streamlines workflows, and reduces costs for modern teams.

Product

  • Features
  • Pricing
  • Documentation

Features

  • Chat
  • Bookkeeping
  • Double-entry
  • Finances
  • Financial Approvals
  • Invoices
  • Whiteboard
  • Files
  • Meet
  • Tasks
  • Calendar
  • CRM

Solutions

  • Agencies
  • Operations
  • Finance & Admin
  • Projects
  • Freelancers
  • Governance
  • Teams + Finance
  • Projects + Bookkeeping
  • Design studios
  • Consultants
  • Remote teams
  • Projects + Invoicing
  • Client Portal
  • Projects + Approvals

Compare

  • vs 17hats
  • vs Airtable
  • vs Asana
  • vs Basecamp
  • vs ClickUp
  • vs Discord
  • vs Dropbox
  • vs Google Workspace
  • vs Jira
  • vs Linear
  • vs Microsoft Teams
  • vs Miro
  • vs monday.com
  • vs Notion
  • vs Plutio
  • vs QuickBooks
  • vs Rock
  • vs Salesforce
  • vs Slack
  • vs Smartsheet
  • vs Trello
  • vs Wimi
  • vs Wrike

Free tools

  • Invoice generator
  • Quote generator
  • VAT calculator
  • Profit margin calculator
  • Hourly rate calculator
  • Gantt chart maker
  • Online whiteboard
  • Time zone meeting planner
  • UTM builder
  • Email signature generator
  • Image resizer
  • Color contrast checker
  • QR code generator

Company

  • About
  • Blog
  • support@lyniti.com
  • Service status

Legal

  • Trust Center
  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • Data Processing Agreement
  • Imprint

© 2026 Lyniti. All rights reserved.

Made with love and Lyniti