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

:::info
`Blobs.toHex` is a re-export of ox's [`Blobs.toHex`](https://oxlib.sh/api/Blobs/toHex). 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.toHex(blobs) // [!code focus]
// @log: '0xdeadbeef'
```

## Definition

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

## Parameters

### blobs

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

## Return Type

`toHex.ReturnType`
