> **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.

# Blobs.to

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

Transforms Ox-shaped [`Blobs.Blobs`](/docs/utilities/blobs/types#blobs) into the originating data.

## Imports

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

## Examples

```ts twoslash
// @noErrors
import { Blobs, Hex } from 'viem/utils'

const blobs = Blobs.from('0xdeadbeef')
const data = Blobs.to(blobs) // [!code focus]
// @log: '0xdeadbeef'
```

### Configuring Return Type

It is possible to configure the return type with second argument.

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

const blobs = Blobs.from('0xdeadbeef')
const data = Blobs.to(blobs, 'Bytes')
// @log: Uint8Array [ 13, 174, 190, 239 ]
```

## Definition

```ts
function to<blobs, to>(
  blobs: blobs | Blobs<Hex.Hex> | Blobs<Bytes.Bytes>,
  to?: to | 'Hex' | 'Bytes',
): to.ReturnType<to>
```

## Parameters

### blobs

* **Type:** `blobs | Blobs<Hex.Hex> | Blobs<Bytes.Bytes>`

The [`Blobs.Blobs`](/docs/utilities/blobs/types#blobs) to transform.

### to

* **Type:** `to | 'Hex' | 'Bytes'`
* **Optional**

The type to transform to.

## Return Type

The originating data.

`to.ReturnType<to>`
