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

# AbiItem.format

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

Formats an [`AbiItem.AbiItem`](/docs/utilities/abiitem/types#abiitem) into a **Human Readable ABI Item**.

## Imports

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

## Examples

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

const formatted = AbiItem.format({
  type: 'function',
  name: 'approve',
  stateMutability: 'nonpayable',
  inputs: [
    {
      name: 'spender',
      type: 'address'
    },
    {
      name: 'amount',
      type: 'uint256'
    }
  ],
  outputs: [{ type: 'bool' }]
})

formatted
//    ^?
```

## Definition

```ts
function format<abiItem>(
  abiItem: abiItem | AbiItem,
): format.ReturnType<abiItem>
```

## Parameters

### abiItem

* **Type:** `abiItem | AbiItem`

The ABI Item to format.

## Return Type

The formatted ABI Item .

`format.ReturnType<abiItem>`
