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
)
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.
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.
- 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.
- 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.
- 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.
- Copy the format you needCopy HEX, rgb(), hsl(), oklch(), or the original color(display-p3 …) declaration. Every format is one click away.
- 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.
- 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 space | Gamut coverage | Typical use | Web syntax |
|---|---|---|---|
| sRGB | Baseline | Web, standard monitors | #RRGGBB, rgb() |
| Display P3 | ~25% more than sRGB | Apple devices, modern laptops, iPhones | color(display-p3 r g b) |
| DCI-P3 | Same primaries, different white point | Cinema and video editing | Not a CSS color space |
| Rec. 2020 | Even wider | UHD broadcast, HDR | color(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:
- Clip: any channel outside 0 to 255 is forced to the nearest limit. Simple and fast, but vivid P3 colors lose saturation.
- Gamut-map: the color is shifted toward the sRGB gamut while preserving hue and lightness as closely as possible. More natural result, slightly different HEX.
- OKLCH preserve: convert to OKLCH, reduce chroma until the color fits sRGB, then convert to HEX. Best for perceptual accuracy.
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
| Property | Display P3 | sRGB / HEX |
|---|---|---|
| Primaries | Wider (P3 primaries) | Narrower (sRGB / Rec. 709) |
| White point | D65 | D65 |
| Transfer function | sRGB gamma | sRGB gamma |
| Number of colors | ~25% more than sRGB | ~16.7 million (24-bit) |
| Typical screens | iPhone, iPad, MacBook, modern laptops | Almost every screen |
| CSS syntax | color(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:
- Decode your Display P3 gamma-encoded channels (0 to 1) with the sRGB transfer function into linear light.
- Multiply by the standard P3 → XYZ matrix.
- Multiply by the standard XYZ → linear sRGB matrix.
- 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
- Use P3 when you want richer, more saturated colors on modern Apple devices and wide-gamut monitors: product photography, brand hero sections, video thumbnails, iPhone wallpaper design.
- Use HEX when you need maximum compatibility and predictable results across every browser, email client, PDF, and print export.
- Use OKLCH when you want perceptual control over a wide-gamut color and need to gamut-map gracefully. OKLCH is the best format for palettes and theming that should look even across sRGB and P3.
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
| Name | Display P3 | sRGB HEX | Notes |
|---|---|---|---|
| P3 Red | color(display-p3 1 0 0) | #FF0000 | Slightly clipped; real P3 red is more saturated. |
| P3 Green | color(display-p3 0 1 0) | #00FF00 | Significantly clipped; real P3 green is much more saturated. |
| P3 Blue | color(display-p3 0 0 1) | #0000FF | Near sRGB boundary; small loss. |
| Apple Blue | color(display-p3 0 0.478 1) | #007AFF | The system blue used across iOS. |
| Apple Green | color(display-p3 0.204 0.780 0.349) | #34C759 | iOS system green. |
| Apple Pink | color(display-p3 1 0.176 0.333) | #FF2D55 | iOS system pink. |
| Apple Purple | color(display-p3 0.686 0.322 0.871) | #AF52DE | iOS 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.