Menu

HEX to Display P3 Converter

Convert any HEX color to Display P3 in real time. See gamut status, get ready-to-paste color(display-p3 ...) CSS, and compare sRGB vs P3 side by side.

🎨 sRGB (HEX)
sRGB
🌈 Display P3
display-p3

Side-by-side comparison

sRGB
Display P3

On a P3-capable display, the right side renders slightly more saturated for colors near the sRGB edge. On sRGB-only screens, both sides render identically.

Chromaticity & delta

Export


        

Saved colors

What is the HEX to Display P3 converter?

A HEX to Display P3 converter translates a standard sRGB HEX color into the wider Display P3 color space used by modern Apple, Android, and 4K displays. It decodes the HEX into linear-light sRGB, applies a 3×3 matrix to transform it into Display P3 primaries, and re-applies the sRGB transfer curve to produce the display-ready color(display-p3 r g b) values. Because Display P3 fully contains sRGB, every HEX color is in-gamut — so the conversion is always exact. The tool also converts in the other direction, flags out-of-gamut P3 colors, and generates ready-to-paste CSS with a @supports fallback.

Key takeaways

  • Every sRGB HEX color is inside the Display P3 gamut, so HEX → P3 conversion is exact.
  • Display P3 covers about 25% more visible color than sRGB — especially in reds and greens.
  • Use CSS color(display-p3 r g b) with a @supports fallback so sRGB-only displays still render correctly.
  • P3 is supported by Safari 10.1+, Chrome 111+, Firefox 113+, and Edge 111+.
  • HEX → P3 conversions are lossless; P3 → HEX uses CSS Color 4 gamut mapping when the P3 color falls outside sRGB.

Built and maintained by the BestColorPicker team. Last updated .

How to use the HEX to Display P3 converter

  1. Enter your HEX colorType a 3-digit or 6-digit HEX code, or pick a color from the swatch. Any valid sRGB HEX works: #FF0066, #f06, #1E90FF.
  2. Read the Display P3 resultThe converter shows the color(display-p3 ...) values, the P3 HEX approximation, and each channel as a decimal. Everything is live — no button required.
  3. Check the gamut statusYou see whether your sRGB color falls inside the Display P3 gamut or outside it. In-gamut colors convert 1:1. Out-of-gamut colors get a gamut-mapped version with a side-by-side delta.
  4. Compare sRGB vs P3 side by sideThe preview shows your color in sRGB next to the P3 version, with an optional splodge fill so you can judge the difference visually.
  5. Copy the CSS, Tailwind, or JSONCopy the ready-to-paste CSS declaration with @supports fallback, a Tailwind v4 @theme block, or a JSON object with sRGB, P3, and OKLCH values.
  6. Download a PNG swatch cardSave a shareable PNG card with your HEX, P3 values, and a color swatch — perfect for design handoff or documentation.

What is Display P3?

Display P3 is a wide-gamut RGB color space developed by Apple. It uses the same RGB primaries as DCI-P3, the cinema standard, but pairs them with the D65 white point and the sRGB transfer function. That makes Display P3 a drop-in, backwards-compatible wider-gamut replacement for sRGB — which is why Apple adopted it for iPhones, iPads, Macs, and most modern Android devices.

Color spaceCoverage of visible spectrumBest forSupport
sRGB~35% of visible colorsStandard web colors, legacy screensUniversal
Display P3~45% of visible colorsWide-gamut screens, photos, modern CSSSafari 10.1+, Chrome 111+, Firefox 113+, Edge 111+
Rec. 2020~75% of visible colorsHDR video, future displaysLimited browser CSS support

HEX → P3 conversion math

The conversion runs in five steps:

  1. Decode HEX → sRGB. Split #FF0066 into R=255, G=0, B=102, then normalize to 0–1.
  2. Remove the sRGB gamma. Apply the sRGB transfer function to get linear-light RGB. This is what the display physically emits before gamma correction.
  3. Transform sRGB linear → P3 linear. Multiply the RGB triplet by a 3×3 matrix that maps sRGB primaries to Display P3 primaries. Both spaces share the D65 white point, so no chromatic adaptation is needed.
  4. Re-apply the sRGB transfer function. Gamma-encode the linear P3 values back into the 0–1 display-referred range.
  5. Format as CSS. Wrap in color(display-p3 r g b), using up to four decimal places.

Because Display P3 contains the entire sRGB volume, no channel ever falls outside the 0–1 range after step 3 for HEX input. The conversion is exact and reversible.

What about P3 → HEX and out-of-gamut colors?

P3 → sRGB is the harder direction. Some saturated P3 colors (especially neon greens, vivid cyans, and bright magentas) have no sRGB equivalent. For these, the tool applies CSS Color 4 gamut mapping, which preserves lightness and hue while reducing chroma until the color fits inside sRGB. The result is a HEX that is close but not identical, flagged with an out-of-gamut warning.

In practice, for any normal HEX input to this converter, the sRGB round-trip is always exact. Warnings only matter when you paste in a P3 color that was already outside sRGB.

How to use color(display-p3) in CSS

/* Modern P3-aware browsers render the second declaration. */
/* Older sRGB-only browsers ignore it and keep the HEX. */
.card {
  background-color: #FF0066;
  background-color: color(display-p3 1 0 0.4);
}

/* The @supports pattern is the most explicit version. */
@supports (color: color(display-p3 1 1 1)) {
  .card {
    background-color: color(display-p3 1 0 0.4);
  }
}

The tool generates both patterns. The @supports version is more explicit and easier to debug. Both work because unsupported browsers discard the invalid declaration and keep the earlier sRGB value.

Display P3 in Tailwind CSS

Tailwind v4 accepts any valid CSS color, including color(display-p3 ...). Use the @theme block:

@theme {
  --color-brand: color(display-p3 1 0 0.4);
}

Tailwind v3 and earlier do not support the color() function in the config file. Use the sRGB HEX in tailwind.config.js, and add the color(display-p3 ...) declaration via your own CSS layer if you want wide gamut.

Which screens display P3?

DeviceP3 support
iPhone 7 and laterYes (Retina HD / Super Retina XDR)
iPad Pro (2016+), iPad Air (2019+)Yes
MacBook Pro Retina, Mac Studio DisplayYes
Modern Android flagship phones (Pixel 6+, Galaxy S21+)Yes
4K and 8K HDR TVs (2020+)Yes (DCI-P3)
Standard office monitors, budget laptopsOften sRGB only

Why use Display P3 for web colors?

Common HEX to Display P3 mistakes

Frequently asked questions

What is Display P3?

Display P3 is a wide-gamut color space developed by Apple. It uses the DCI-P3 primaries with a D65 white point and the sRGB transfer function. It covers roughly 25 percent more of the visible color spectrum than sRGB, especially in saturated reds and greens. Modern iPhones, iPads, Macs, and many Android phones and 4K TVs ship with P3-capable displays.

How does HEX to Display P3 conversion work?

HEX is a plain sRGB triplet. The converter first decodes the HEX into linear-light sRGB using the standard sRGB transfer function, then applies a 3×3 matrix that transforms sRGB linear RGB into Display P3 linear RGB. Finally it re-applies the gamma curve to produce the display-ready P3 values. Because P3 is a larger gamut than sRGB, every sRGB color fits inside P3, so no clipping is needed for HEX input.

Is every HEX color inside the Display P3 gamut?

Yes. Every color that can be expressed in sRGB is mathematically inside the Display P3 gamut, because P3 contains the whole sRGB volume. So HEX-to-P3 conversions are always exact. The out-of-gamut warnings appear when you go the other way — entering a P3 or wide-gamut color and converting it to sRGB.

How do I use color(display-p3 ...) in CSS?

Use the CSS color() function: color(display-p3 1 0 0) for pure red. You can also use the display-p3-prefixed keyword equivalents like color(display-p3 0.5 0.2 0.8). To support older browsers, wrap it in @supports (color: color(display-p3 1 1 1)) with an sRGB hex fallback underneath. The tool generates this pattern for you automatically.

Which browsers support color(display-p3)?

All modern browsers support it: Safari 10.1+ (2018), Chrome 111+ (2023), Firefox 113+ (2023), and Edge 111+. Older browsers ignore the declaration if you provide an sRGB fallback, which is why the tool always generates a fallback pattern.

Why does a P3 color look different from the same HEX on my screen?

Two reasons. First, if your display is not P3-capable, the browser approximates the P3 color in sRGB, which flattens the extra saturation. Second, most HEX colors inside the sRGB gamut look identical in P3 because the extra gamut is only used by colors that need it. You will notice real differences only with highly saturated colors on a P3 display.

What is gamut mapping and why does it matter?

Gamut mapping is the process of adjusting a color that falls outside a target gamut so that it can be displayed. When you convert a wide-gamut P3 color to sRGB, the out-of-gamut channels must be compressed. CSS Color 4 defines a standard gamut mapping algorithm that preserves lightness and hue while reducing chroma. This tool applies that algorithm when converting P3 back to sRGB.

How do I convert Display P3 to HEX?

Open the tool, paste a color(display-p3 r g b) value or choose a wide-gamut swatch, and read the HEX in the output. If the P3 color is out of the sRGB gamut, the tool shows the closest sRGB approximation using CSS Color 4 gamut mapping, and warns you that the HEX is not an exact match.

Does Display P3 work in Tailwind CSS?

Yes. Tailwind v4 accepts any valid CSS color, including color(display-p3 ...). Use the @theme block that the tool generates: --color-brand: color(display-p3 0.9 0.2 0.4); Tailwind v3 and below do not accept the color() function in the config file, so use the sRGB HEX there.

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

DCI-P3 is the cinema standard with a different white point and gamma curve. Display P3 uses the same RGB primaries as DCI-P3 but pairs them with the sRGB white point (D65) and the sRGB transfer function. That makes Display P3 a drop-in wider-gamut replacement for sRGB, which is why Apple adopted it for screens.

Does converting HEX to P3 change the color on an sRGB screen?

No. Browsers and image viewers fall back to sRGB when a P3 color is shown on an sRGB-only display. If your color is inside the sRGB gamut, both sRGB and P3 versions render identically. Only out-of-gamut colors (which HEX cannot represent) will look different, and they will look slightly muted or clipped on sRGB screens.

Can I convert P3 to HEX inside this tool?

Yes. Paste a color(display-p3 r g b) value into the input, and the tool shows the sRGB HEX alongside the exact P3 values. If the color is outside the sRGB gamut, the HEX is the closest approximation using CSS Color 4 gamut mapping, and the tool flags it with a warning badge.

Why is my HEX the same as the P3 value?

For colors well inside the sRGB gamut, P3 and sRGB values are numerically close because both use the same white point and transfer function. The small differences come from the different primary color coordinates. For most "web" colors the visual difference is negligible.

Is the HEX to Display P3 converter free?

Yes. The converter is completely free, requires no account, and runs entirely in your browser. Nothing you enter leaves your device.

More color tools

Sources and further reading