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

# Json.parse

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

Parses a JSON string, with support for `bigint`.

## Imports

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

## Examples

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

const json = Json.parse(
  '{"foo":"bar","baz":"69420694206942069420694206942069420694206942069420#__bigint"}'
)
// @log: {
// @log:   foo: 'bar',
// @log:   baz: 69420694206942069420694206942069420694206942069420n
// @log: }
```

## Definition

```ts
function parse(
  string: string,
  reviver?: (this: any, key: string, value: any) => any,
): any
```

## Parameters

### string

* **Type:** `string`

The value to parse.

### reviver

* **Type:** `(this: any, key: string, value: any) => any`
* **Optional**

A function that transforms the results.

## Return Type

The parsed value.

`any`
