> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PARSE_JSON

> Parses JSON text into a VARIANT value.

<div className="e6-meta"><span className="e6-eyebrow e6-eyebrow--quiet">Scalar function</span></div>

SQL NULL, empty text and whitespace-only text return SQL NULL. Text containing JSON null produces a VARIANT JSON-null value distinct from SQL NULL.

## Syntax

### Scalar

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
parse_json(json_string)
```

### Snowflake (scalar)

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
parse_json(json_string [, mode])
```

* Snowflake context only.

## Arguments

### Scalar

| Name | Type | Required | Description |
| - | - | - | - |
| json\_string | STRING | Yes | JSON text to parse. |

### Snowflake

| Name | Type | Required | Description |
| - | - | - | - |
| json\_string | STRING | Yes | JSON text to parse. |
| mode | STRING | No | Duplicate-key parsing mode. 's'/'S' or 'd'/'D' Must be a constant argument. Default: 's' (strict). |

## Returns

* Type: VARIANT
* NULL behavior: SQL NULL, empty text and whitespace-only text return SQL NULL. Text containing JSON null produces a VARIANT JSON-null value distinct from SQL NULL.
* Shape: A VARIANT scalar, object, or array. This is a VARIANT value rather than an ordinary SQL STRUCT.
* Ordering: Array element order is preserved; object-key order is not a SQL ordering guarantee.

## Properties

| Property | Value |
| - | - |
| Deterministic | Yes |
| Supports window usage | No |
| Exact result | Partial (Fractional JSON values use DOUBLE; their decimal precision is not necessarily retained.) |

## Usage notes

* Default strict mode rejects duplicate object keys. Snowflake mode may select last-write-wins duplicate handling using a constant mode argument.
* Fractional JSON numbers are encoded as DOUBLE instead of fixed-point decimal.
* Deterministic: The same inputs and settings produce the same result.

## Examples

### Typical behavior

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT typeof(parse_json('{"a":1}')) AS "value";
```

| value |
| - |
| variant |

### Read a nested value after parsing

```sql theme={"theme":{"light":"github-light","dark":"github-dark"}}
SELECT get_path(parse_json('{"items":[10,20]}'), '$.items[1]') AS second_item;
```

| second\_item |
| - |
| 20 |

## Limitations

* A VARIANT value’s total encoded size is limited to 128 MiB.
* Only Snowflake context supports the optional mode argument. Modes s/S and d/D are recognized; NULL, nonconstant or other mode values are argument errors even for TRY\_PARSE\_JSON.
* PARSE\_JSON raises a per-row parsing error; TRY\_PARSE\_JSON converts per-row parsing failures to NULL but does not suppress argument validation errors.

## Related functions

* [get\_path](/query/sql/functions/json/get_path)
* [variant\_get](/query/sql/functions/json/variant_get)
* [try\_parse\_json](/query/sql/functions/json/try_parse_json)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.