---
title: ConvertibleFromBytes
framework: Swift
role: symbol
role_heading: Protocol
platforms: [iOS 8.0+, iPadOS 8.0+, Mac Catalyst 13.0+, macOS 10.10+, tvOS 9.0+, visionOS 1.0+, watchOS 2.0+]
path: swift/convertiblefrombytes
---

# ConvertibleFromBytes

A protocol for types whose memory can safely be populated from raw bytes, resulting in a valid instance.

## Declaration

```swift
protocol ConvertibleFromBytes : BitwiseCopyable
```

## Overview

Overview A type can conform to ConvertibleFromBytes if every bit pattern for every byte of its stored properties is valid. Note that this allows conformances for types with internal or trailing padding. A conformer to ConvertibleFromBytes must not have semantic constraints on the values of its stored properties. All its stored properties must themselves conform to ConvertibleFromBytes.

## Relationships

### Inherits From

- [BitwiseCopyable](swift/bitwisecopyable.md)

### Conforming Types

- [CollectionOfOne](swift/collectionofone.md)
- [Double](swift/double.md)
- [Duration](swift/duration.md)
- [Float](swift/float.md)
- [Float16](swift/float16.md)
- [Float80](swift/float80.md)
- [InlineArray](swift/inlinearray.md)
- [Int](swift/int.md)
- [Int128](swift/int128.md)
- [Int16](swift/int16.md)
- [Int32](swift/int32.md)
- [Int64](swift/int64.md)
- [Int8](swift/int8.md)
- [PartialRangeFrom](swift/partialrangefrom.md)
- [PartialRangeFrom.Iterator](swift/partialrangefrom/iterator.md)
- [PartialRangeThrough](swift/partialrangethrough.md)
- [PartialRangeUpTo](swift/partialrangeupto.md)
- [UInt](swift/uint.md)
- [UInt128](swift/uint128.md)
- [UInt16](swift/uint16.md)
- [UInt32](swift/uint32.md)
- [UInt64](swift/uint64.md)
- [UInt8](swift/uint8.md)

## See Also

### Safe Access to Raw Bytes

- [FullyInhabited](swift/fullyinhabited.md)
- [ConvertibleToBytes](swift/convertibletobytes.md)
- [ByteOrder](swift/byteorder.md)
- [bitCast(_:to:)](swift/bitcast(_:to:).md)
