<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/UnitEnergy",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSUnitEnergy"
  },
  "title" : "UnitEnergy"
}
-->

# UnitEnergy

A unit of measure for energy.

```
class UnitEnergy
```

## Overview

You typically use instances of [`UnitEnergy`](/documentation/Foundation/UnitEnergy) to represent specific quantities of energy using the [`NSMeasurement`](/documentation/Foundation/NSMeasurement) class.

### Energy

Energy is a fundamental property of matter than can be transferred and converted into different forms, such as kinetic, electric, and thermal. The SI unit for energy is the joule (J), which is derived as the work of one meter of displacement in the direction of a force of one newton (1J = 1N ∙ 1m). It can also be derived as the work required to displace an electric charge of one coulomb through an electrical potential difference of one volt (1J = 1C ∙ 1V), or the work required to produce one watt of power for one second (1J = 1W ∙ 1s). Energy is also commonly expressed in terms of the calorie (cal), or the energy needed to raise the temperature of one gram of water by one degree Celsius at a pressure of one atmosphere (1cal ≡ 4.184J).

The [`UnitEnergy`](/documentation/Foundation/UnitEnergy) class defines its [`baseUnit()`](/documentation/Foundation/Dimension/baseUnit()) as [`joules`](/documentation/Foundation/UnitEnergy/joules), and provides the following units, which are initialized using [`UnitConverterLinear`](/documentation/Foundation/UnitConverterLinear) converters with the specified coefficients:

|Name          |Method                                                                          |Symbol|Coefficient|
|--------------|--------------------------------------------------------------------------------|------|-----------|
|Kilojoules    |``doc://com.apple.foundation/documentation/Foundation/UnitEnergy/kilojoules``   |kJ    |`1000.0`   |
|Joules        |``doc://com.apple.foundation/documentation/Foundation/UnitEnergy/joules``       |J     |`1.0`      |
|Kilocalories  |``doc://com.apple.foundation/documentation/Foundation/UnitEnergy/kilocalories`` |kCal  |`4184.0`   |
|Calories      |``doc://com.apple.foundation/documentation/Foundation/UnitEnergy/calories``     |cal   |`4.184`    |
|Kilowatt Hours|``doc://com.apple.foundation/documentation/Foundation/UnitEnergy/kilowattHours``|kWh   |`3600000.0`|

## Topics

### Accessing the Base Unit

[`+  baseUnit`](/documentation/Foundation/Dimension/baseUnit())

Returns the base unit.

### Accessing Predefined Units

[`kilojoules`](/documentation/Foundation/UnitEnergy/kilojoules)

The kilojoules unit of energy.

[`joules`](/documentation/Foundation/UnitEnergy/joules)

The joules unit of energy.

[`kilocalories`](/documentation/Foundation/UnitEnergy/kilocalories)

The kilocalories unit of energy.

[`calories`](/documentation/Foundation/UnitEnergy/calories)

The calories unit of energy.

[`kilowattHours`](/documentation/Foundation/UnitEnergy/kilowattHours)

The kilowatt hours unit of energy.

## Relationships

### Conforms To

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Hashable`](/documentation/Swift/Hashable)

[`NSCoding`](/documentation/Foundation/NSCoding)

### Inherits From

[`Dimension`](/documentation/Foundation/Dimension)

---

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)