---
title: UnitLength
framework: foundation
role: symbol
role_heading: Class
path: foundation/unitlength
---

# UnitLength

A unit of measure for length.

## Declaration

```swift
class UnitLength
```

## Overview

Overview You typically use instances of UnitLength to represent specific quantities of length using the NSMeasurement class. Length Length is the dimensional extent of matter. The SI unit for length is the meter (m), which is defined in terms of the distance traveled by light in a vacuum. The UnitLength class defines its baseUnit() as meters, and provides the following units, which are initialized using UnitConverterLinear converters with the specified coefficients:  |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |   |  |  |

## Topics

### Accessing the Base Unit

- [baseUnit()](foundation/dimension/baseunit().md)

### Accessing Predefined Units

- [megameters](foundation/unitlength/megameters.md)
- [kilometers](foundation/unitlength/kilometers.md)
- [hectometers](foundation/unitlength/hectometers.md)
- [decameters](foundation/unitlength/decameters.md)
- [meters](foundation/unitlength/meters.md)
- [decimeters](foundation/unitlength/decimeters.md)
- [centimeters](foundation/unitlength/centimeters.md)
- [millimeters](foundation/unitlength/millimeters.md)
- [micrometers](foundation/unitlength/micrometers.md)
- [nanometers](foundation/unitlength/nanometers.md)
- [picometers](foundation/unitlength/picometers.md)
- [inches](foundation/unitlength/inches.md)
- [feet](foundation/unitlength/feet.md)
- [yards](foundation/unitlength/yards.md)
- [miles](foundation/unitlength/miles.md)
- [scandinavianMiles](foundation/unitlength/scandinavianmiles.md)
- [lightyears](foundation/unitlength/lightyears.md)
- [nauticalMiles](foundation/unitlength/nauticalmiles.md)
- [fathoms](foundation/unitlength/fathoms.md)
- [furlongs](foundation/unitlength/furlongs.md)
- [astronomicalUnits](foundation/unitlength/astronomicalunits.md)
- [parsecs](foundation/unitlength/parsecs.md)

### Initializers

- [init(forLocale:usage:)](foundation/unitlength/init(forlocale:usage:).md)

## Relationships

### Inherits From

- [Dimension](foundation/dimension.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Physical Dimension

- [UnitArea](foundation/unitarea.md)
- [UnitVolume](foundation/unitvolume.md)
- [UnitAngle](foundation/unitangle.md)
