---
title: PaintWorkletGlobalScope.devicePixelRatio
slug: Web/API/PaintWorklet/devicePixelRatio
tags:
  - CSS Paint API
  - DPI
  - Houdini
  - NeedsBrowserCompatibility
  - NeedsExample
  - NeedsLiveSample
  - Property
  - Reference
  - Worklet
  - devicePixelRatio
  - paintWorklet
browser-compat: api.PaintWorkletGlobalScope.devicePixelRatio
---
{{draft}}{{APIRef("CSS Painting API")}}

The **`PaintWorkletGlobalScope.devicePixelRatio`** read-only property of the {{domxref("PaintWorklet")}} interface returns the current device's ratio of physical pixels to logical pixels.

## Syntax

```js
var devicePixelRatio = PaintWorkletGlobalScope.devicePixelRatio;
```

### Value

A double-precision integer.

## Specifications

{{Specifications}}

## Browser compatibility

{{Compat}}

## See also

- [PaintWorklet](/en-US/docs/Web/API/PaintWorklet)
- [CSS.paintWorklet](/en-US/docs/Web/API/CSS/paintWorklet)
- [Worklet](/en-US/docs/Web/API/Worklet)
- [CSS Painting API](/en-US/docs/Web/API/CSS_Painting_API)
- [Houdini APIs](/en-US/docs/Web/Houdini)
- [Houdini overview](/en-US/docs/Web/Houdini/learn)
- [window.devicePixelRatio](/en-US/docs/Web/API/Window/devicePixelRatio)
