<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "CKToolJS",
  "identifier" : "/documentation/CKToolJS/CKToolDatabaseModule/toByte",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "CKTool JS"
    ],
    "preciseIdentifier" : "clm/CKToolDatabaseModule/toByte"
  },
  "title" : "toByte"
}
-->

# toByte

Converts a numeric value to a `Byte`.

```
static Byte toByte();
```

## Parameters

`value`

A numeric value to convert or validate.

## Return Value

If the value passes validation, this function returns a `Byte`; otherwise it throws `ValueNotByteError`. A numeric value passes validation if it’s an integer in the range 0 to 255, inclusive.

## Discussion

In TypeScript, `Byte` is a branded number type. In JavaScript, it’s a number.

```javascript
import { toByte } from "@apple/cktool.database";
```

---

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)