Menu

Display P3 to HEX Converter

Convert color(display-p3 …) values to HEX, RGB, HSL, and OKLCH instantly. Handles out-of-sRGB-gamut colors with correct clipping and a live side-by-side preview.

color(display-p3 )
R
G
B
Display P3 originalcolor(display-p3 1 0 0)
On wide-gamut screens this is the full P3 color.
HEX / sRGB result#FF0000
What most screens will show.
Gamut: P3 Red is outside the sRGB gamut. Expect clipping.

Light UI preview

Dark UI preview

Quick presets

Click any preset to load it. Values are Display P3 channels from 0 to 1.

Saved conversions

Tap the swatch to reload a saved conversion, or Remove to delete.

CSS output


        

What is a Display P3 to HEX converter?

A Display P3 to HEX converter takes a wide-gamut color written as color(display-p3 r g b) and converts it to a six-digit sRGB HEX code. This converter applies the correct Display P3 to sRGB matrix, gamut-maps or clips out-of-range channels, and shows HEX, RGB, HSL, OKLCH, and CSS output together, with a live side-by-side preview so you can see exactly what most screens will display.

Key takeaways

  • Paste color(display-p3 r g b) or enter R, G, B channels directly.
  • Get HEX, RGB, HSL, OKLCH, and CSS output in one click.
  • Out-of-sRGB-gamut colors are clipped and flagged with a percentage.
  • See the P3 original and the sRGB HEX side by side.
  • Reverse tab converts HEX or RGB back to Display P3.
  • Everything runs in your browser. No uploads, no account.

Built and maintained by the BestColorPicker team. Last updated .

How to use the Display P3 to HEX converter

Convert any P3 color to a valid sRGB HEX code in under a minute. Follow these steps.

  1. Paste or type your Display P3 colorEnter a color(display-p3 r g b) value, or use the individual R, G, and B inputs. Channels accept 0 to 1 values. Values outside 0 to 1 are allowed and clipped on output.
  2. Read the HEX, RGB, and OKLCH outputThe converter applies the correct Display P3 to sRGB matrix, gamut-maps out-of-range values, and shows HEX, RGB, HSL, OKLCH, and CSS output at once.
  3. Check the gamut warningIf your P3 color is outside sRGB, the tool shows how much was clipped and a visual side-by-side of the original P3 versus the sRGB HEX version.
  4. Copy the format you needCopy HEX, rgb(), hsl(), oklch(), or the original color(display-p3 …) declaration. Every format is one click away.
  5. Preview on real UISee the color as a button, badge, card, and text on light and dark surfaces, so you can judge it in context before you ship it.
  6. Pick from presets or paste a HEXJump to a common P3 color like P3 Red or P3 Green, or convert HEX back to P3 in the reverse tab for round-trip checks.

What is Display P3?

Display P3 is a wide-gamut color space introduced by Apple. It uses the DCI-P3 primaries, a D65 white point, and the sRGB transfer function. It covers roughly 25 percent more colors than sRGB, especially in the reds, greens, and oranges that photographers and video editors care about.

Color spaceGamut coverageTypical useWeb syntax
sRGBBaselineWeb, standard monitors#RRGGBB, rgb()
Display P3~25% more than sRGBApple devices, modern laptops, iPhonescolor(display-p3 r g b)
DCI-P3Same primaries, different white pointCinema and video editingNot a CSS color space
Rec. 2020Even widerUHD broadcast, HDRcolor(rec2020 r g b)

Why P3 colors change when converted to HEX

HEX is a six-digit notation and by CSS definition it describes an sRGB color. If you write a P3 color and ask for a HEX, the browser (or this converter) must fit the wide-gamut color into the smaller sRGB gamut. There are three ways that can go:

This converter uses relative colorimetric clipping for the HEX output, and it also shows the OKLCH value so you can see exactly what was lost and re-enter a chroma-reduced color if you need one. Every out-of-gamut color triggers the gamut warning bar with a percentage so you know how much was clipped.

Display P3 vs sRGB vs HEX: what really changes

PropertyDisplay P3sRGB / HEX
PrimariesWider (P3 primaries)Narrower (sRGB / Rec. 709)
White pointD65D65
Transfer functionsRGB gammasRGB gamma
Number of colors~25% more than sRGB~16.7 million (24-bit)
Typical screensiPhone, iPad, MacBook, modern laptopsAlmost every screen
CSS syntaxcolor(display-p3 r g b)#RRGGBB, rgb(), hsl()

How the conversion works (math)

The converter runs four steps, all of which are correct to the CSS Color Module Level 4 reference conversions:

  1. Decode your Display P3 gamma-encoded channels (0 to 1) with the sRGB transfer function into linear light.
  2. Multiply by the standard P3 → XYZ matrix.
  3. Multiply by the standard XYZ → linear sRGB matrix.
  4. Encode the linear sRGB channels back with the sRGB transfer function, clip to 0 to 255, and round to produce the HEX.

Because the matrices are the standard CSS reference values, the result matches what Chrome, Safari, and Firefox compute for color(display-p3 …) when they render on a non-wide-gamut screen.

When to use P3 and when to use HEX

Many design systems ship both: a P3 declaration with an sRGB fallback, so wide-gamut devices get the vivid color and everything else gets a safe approximation. That pattern looks like this:

.brand-hero {
  background: #FF0000; /* sRGB fallback */
}
@supports (color: color(display-p3 1 0 0)) {
  .brand-hero {
    background: color(display-p3 1 0 0);
  }
}

To fine-tune the wide-gamut version, use the OKLCH Color Picker and paste the resulting P3 value back here.

Common Display P3 to HEX conversions

NameDisplay P3sRGB HEXNotes
P3 Redcolor(display-p3 1 0 0)#FF0000Slightly clipped; real P3 red is more saturated.
P3 Greencolor(display-p3 0 1 0)#00FF00Significantly clipped; real P3 green is much more saturated.
P3 Bluecolor(display-p3 0 0 1)#0000FFNear sRGB boundary; small loss.
Apple Bluecolor(display-p3 0 0.478 1)#007AFFThe system blue used across iOS.
Apple Greencolor(display-p3 0.204 0.780 0.349)#34C759iOS system green.
Apple Pinkcolor(display-p3 1 0.176 0.333)#FF2D55iOS system pink.
Apple Purplecolor(display-p3 0.686 0.322 0.871)#AF52DEiOS system purple.

Display P3 in browsers

As of 2024, the color() function with the display-p3 color space is supported in Safari, Chrome, Edge, Firefox, and Opera. On non-wide-gamut displays, the browser automatically maps P3 colors to sRGB, so you can safely ship P3 without a fallback if you are comfortable with the mapping the browser chooses. This converter uses the same reference math as the browser, so the HEX result on an sRGB-only screen will match what the browser shows.

Use @supports (color: color(display-p3 1 0 0)) when you want to guard the P3 declaration, especially for email templates and older rendering engines.

Frequently asked questions

What is Display P3?

Display P3 is a wide-gamut color space defined by Apple. It covers roughly 25 percent more colors than sRGB, especially in reds, greens, and oranges. On the web it is written as color(display-p3 r g b) in the CSS Color Module Level 4 syntax.

How do I convert Display P3 to HEX?

Paste a color(display-p3 r g b) value or enter the R, G, and B channels. The converter applies the Display P3 to sRGB matrix, clips or gamut-maps the result to the 0 to 255 range, and returns a six-digit HEX code.

Why does P3 to HEX lose color?

HEX and sRGB cannot represent every Display P3 color. P3 reds, greens, and vivid oranges often fall outside the sRGB gamut. The converter must either clip or gamut-map those channels, which is why the preview may look slightly duller than the original P3 color on a wide-gamut screen.

Is HEX the same as sRGB?

A six-digit HEX code in CSS is defined in the sRGB color space unless you explicitly specify a different color space with a CSS color function. So converting P3 to HEX is effectively converting P3 to sRGB, then writing the result in hex notation.

Does the converter handle out-of-range P3 values?

Yes. P3 channels can technically be outside 0 to 1, which extends the gamut further. The converter accepts those values and uses relative colorimetric clipping to sRGB, with a visible warning and a percentage of how much was clipped.

What is the difference between Display P3 and DCI-P3?

Display P3 uses the DCI-P3 primaries with a D65 white point and the sRGB transfer function. DCI-P3 uses a different white point and a different gamma curve for cinema. They look similar but are not interchangeable.

What is OKLCH and why is it in the output?

OKLCH describes a color with lightness, chroma, and hue in a perceptually uniform space. It is shown alongside HEX because OKLCH is the best format for adjusting a wide-gamut color perceptually, especially when the sRGB HEX looks clipped.

Can I convert HEX back to Display P3?

Yes. Use the reverse tab to enter a HEX or RGB color and get the matching color(display-p3 r g b) value. This is useful for round-trip checks and for building a wide-gamut CSS palette from an existing sRGB design.

Are the converted HEX colors valid CSS?

Yes. HEX codes are valid CSS colors and are interpreted as sRGB. Use the CSS tab to copy a ready-to-paste declaration, or use the oklch() tab for a wide-gamut declaration that works in modern browsers.

Which browsers support color(display-p3)?

Safari was first, and Chrome, Edge, Firefox, and most modern browsers now support the color() function in CSS Color Module Level 4. On screens that are not wide-gamut, P3 colors are automatically mapped to sRGB by the browser, which produces a result very close to this converter.

Is this tool free?

Yes. The Display P3 to HEX converter is free, needs no account, and runs entirely in your browser.

Does the converter upload my data?

No. All conversion runs in your browser with plain JavaScript. Nothing is uploaded, stored on a server, or shared.

More color tools

Sources and further reading