---
id: api/cypress-api/platform
title: Cypress.platform
description: Get the underlying OS name as returned from Node's os.platform() in Cypress.
section: api
source_path: docs/api/cypress-api/platform.mdx
version: eb74b56863422c99408aa2276c3f61c0f3e2e2c4
updated_at: '2026-09-21T01:40:23.483Z'
---
# Cypress.platform

`Cypress.platform` returns the underlying OS name, as returned from Node's [`os.platform()`](https://nodejs.org/api/os.html#os_os_platform).

Even though Cypress runs in the browser, it automatically makes this property available for use in your tests.

## Syntax

```
Cypress.platform // 'darwin'
```

## Examples

### Conditionals

```
it('selects all text in the note', () => {
  // if macOS do one thing, else do another
  const modifier = Cypress.platform === 'darwin' ? '{cmd}' : '{ctrl}'

  cy.get('#note').type(`${modifier}a`)
})
```
