---
title: toBase64String
framework: CKTool JS
role: symbol
role_heading: Type Method
platforms: [cktool js 1.2.15+]
path: cktooljs/cktooldatabasemodule/tobase64string
---

# toBase64String

Converts a regular string to a Base64String.

## Declaration

```data
static Base64String toBase64String();
```

## Parameters

- `value`: A string value to convert or validate.

## Return Value

Return Value If the value passes validation, this function returns a Base64String; otherwise it throws ValueNotBase64StringError. A string passes validation if it is a base 64 string.

## Discussion

Discussion In TypeScript, Base64String is a branded string type. In JavaScript, it’s a string. import { toBase64String } from "@apple/cktool.database";
