# Sec-GPC header

The HTTP **`Sec-GPC`** [request header](https://developer.mozilla.org/en-US/docs/Glossary/request%20header) is part of the [Global Privacy Control](https://globalprivacycontrol.org/) (GPC) mechanism to indicate whether the user consents to a website or service selling or sharing their personal information with third parties.

The specification does not define how the user can withdraw or grant consent for website.

<table class="properties">
  <tbody>
    <tr>
      <th scope="row">Header type</th>
      <td>[Request header](https://developer.mozilla.org/en-US/docs/Glossary/Request%20header)</td>
    </tr>
    <tr>
      <th scope="row">[Forbidden request header](https://developer.mozilla.org/en-US/docs/Glossary/Forbidden%20request%20header)</th>
      <td>Yes (<code>Sec-</code> prefix)</td>
    </tr>
  </tbody>
</table>

## Syntax

```http
Sec-GPC: <preference>
```

## Directives

- `<preference>`
  - : A value of `1` means the user has indicated that they prefer their information not be shared with, or sold to, third parties.
    Otherwise, the header is not sent, which indicates that either the user has not made a decision or the user is okay with their information being shared with or sold to third parties.

## Examples

### Reading Global Privacy Control status from JavaScript

The user's GPC preference can also be read from JavaScript using the [Navigator.globalPrivacyControl](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/globalPrivacyControl) or [WorkerNavigator.globalPrivacyControl](https://developer.mozilla.org/en-US/docs/Web/API/WorkerNavigator/globalPrivacyControl) property:

```js
navigator.globalPrivacyControl; // "false" or "true"
```

## Specifications

## Browser compatibility

## See also

- [Navigator.globalPrivacyControl](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/globalPrivacyControl)
- [DNT](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT) header
- [Tk](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Tk) header
- [globalprivacycontrol.org](https://globalprivacycontrol.org/)
- [Do Not Track on Wikipedia](https://en.wikipedia.org/wiki/Do_Not_Track)
