<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HealthKit",
  "identifier" : "/documentation/HealthKit/HKQuantityTypeIdentifier/walkingSpeed",
  "metadataVersion" : "0.1.0",
  "role" : "Type Property",
  "symbol" : {
    "kind" : "Type Property",
    "modules" : [
      "HealthKit"
    ],
    "preciseIdentifier" : "c:@HKQuantityTypeIdentifierWalkingSpeed"
  },
  "title" : "walkingSpeed"
}
-->

# walkingSpeed

A quantity sample type that measures the user’s average speed when walking steadily over flat ground.

```
static let walkingSpeed: HKQuantityTypeIdentifier
```

## Discussion

Walking speed represents how quickly the user walks on flat ground. The system automatically records walking speed samples on iPhone 8 or later. The user must carry their phone near their waist—such as in a pocket—and walk steadily on flat ground. To ensure accuracy, the user’s [`height`](/documentation/HealthKit/HKQuantityTypeIdentifier/height) value must be up to date. The system records 10 to 30 walking speed samples on a typical day. iPhone doesn’t record walking speed samples if the user’s wheelchair status is on.

These samples use distance per time units (described in [`HKUnit`](/documentation/HealthKit/HKUnit)) and measure discrete values (described in [`HKQuantityAggregationStyle`](/documentation/HealthKit/HKQuantityAggregationStyle)).  For example, the following code shows two ways to create a meters per second unit. The first uses explicit constructors, while the second initializes the unit from a string.

```swift
let mps = HKUnit.meter().unitDivided(by: HKUnit.second())
let mpsFromString = HKUnit(from: "m/s")
```

The sample’s [`quantity`](/documentation/HealthKit/HKQuantitySample/quantity) property represents the average walking speed between the sample’s [`startDate`](/documentation/HealthKit/HKSample/startDate) and [`endDate`](/documentation/HealthKit/HKSample/endDate) properties.

## See Also

[`HKDevicePlacementSide`](/documentation/HealthKit/HKDevicePlacementSide)

Values that indicate the placement of the device that measured a sample.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)