> **Can't find what you're looking for?** Use `search_docs` on the docs MCP server at `https://v3.viem.sh/api/mcp` to find what you need.

# Mnemonic.toSeed

:::info
`Mnemonic.toSeed` is a re-export of ox's [`Mnemonic.toSeed`](https://oxlib.sh/api/Mnemonic/toSeed). Refer to the ox documentation for the full reference.
:::

Converts a mnemonic to a master seed.

## Imports

```ts
import { Mnemonic } from 'viem/utils'
```

## Examples

```ts twoslash
// @noErrors
import { Mnemonic } from 'viem/utils'

const mnemonic = Mnemonic.random(Mnemonic.english)
const seed = Mnemonic.toSeed(mnemonic)
// @log: Uint8Array [...64 bytes]
```

## Definition

```ts
function toSeed<as>(
  mnemonic: string,
  options?: toSeed.Options<as>,
): toSeed.ReturnType<as>
```

## Parameters

### mnemonic

* **Type:** `string`

The mnemonic to convert.

### options

* **Type:** `toSeed.Options<as>`
* **Optional**

Conversion options.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`
* **Optional**

The output format.

#### options.passphrase

* **Type:** `string`
* **Optional**

An optional passphrase for additional protection to the seed.

## Return Type

The master seed.

`toSeed.ReturnType<as>`
