<!--
{
  "availability" : [
    "macOS: 10.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTextAlignment",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:@E@NSTextAlignment"
  },
  "title" : "NSTextAlignment"
}
-->

# NSTextAlignment

Constants that specify text alignment.

```
enum NSTextAlignment
```

## Topics

### Constants

[`case left`](/documentation/AppKit/NSTextAlignment/left)

Text is left-aligned.

[`case right`](/documentation/AppKit/NSTextAlignment/right)

Text is right-aligned.

[`case center`](/documentation/AppKit/NSTextAlignment/center)

Text is center-aligned.

[`case justified`](/documentation/AppKit/NSTextAlignment/justified)

Text is justified.

[`case natural`](/documentation/AppKit/NSTextAlignment/natural)

Text uses the default alignment for the current localization of the app.

### Converting to and from Core Text

### Deprecated

[`static const NSTextAlignment NSLeftTextAlignment;`](/documentation/AppKit/NSLeftTextAlignment)

Text is visually left-aligned.

[`static const NSTextAlignment NSRightTextAlignment;`](/documentation/AppKit/NSRightTextAlignment)

Text is visually right-aligned.

[`static const NSTextAlignment NSCenterTextAlignment;`](/documentation/AppKit/NSCenterTextAlignment)

Text is visually center-aligned.

[`static const NSTextAlignment NSJustifiedTextAlignment;`](/documentation/AppKit/NSJustifiedTextAlignment)

Text is justified.

[`static const NSTextAlignment NSNaturalTextAlignment;`](/documentation/AppKit/NSNaturalTextAlignment)

Text uses the default alignment for the current localization of the app.

### Initializers

[`init?(rawValue: Int)`](/documentation/AppKit/NSTextAlignment/init(rawValue:))

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)