JSON Functions

**Syntax**

```
JSONExtractFloat(json[, indices_or_keys, ...])
```

**Arguments**

- `json` — JSON string to parse. [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — A list of zero or more arguments each of which can be either string or integer. [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns a Float value if it exists, otherwise returns `0`. [`Float64`](/docs/sql-reference/data-types/float)

**Examples**

**Usage example**

```
SELECT JSONExtractFloat('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 2) AS res;
```

```
┌─res─┐
│ 200 │
└─────┘
```

## JSONExtractFloatCaseInsensitive[​](#JSONExtractFloatCaseInsensitive "Direct link to JSONExtractFloatCaseInsensitive")

Introduced in: v25.8.0

Parses JSON and extracts a value of Float type using case-insensitive key matching. This function is similar to [`JSONExtractFloat`](#JSONExtractFloat).

**Syntax**

```
JSONExtractFloatCaseInsensitive(json [, indices_or_keys]...)
```

**Arguments**

- `json` — JSON string to parse [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns the extracted Float value, 0 if not found or cannot be converted. [`Float64`](/docs/sql-reference/data-types/float)

**Examples**

**basic**

```
SELECT JSONExtractFloatCaseInsensitive('{"Price": 12.34}', 'PRICE')
```

```
12.34
```

## JSONExtractInt[​](#JSONExtractInt "Direct link to JSONExtractInt")

Introduced in: v20.1.0

Parses JSON and extracts a value of Int type.

**Syntax**

```
JSONExtractInt(json[, indices_or_keys, ...])
```

**Arguments**

- `json` — JSON string to parse. [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — A list of zero or more arguments each of which can be either string or integer. [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns an Int value if it exists, otherwise returns `0`. [`Int64`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Usage example**

```
SELECT JSONExtractInt('{"a": "hello", "b": [-100, 200.0, 300]}', 'b', 1) AS res;
```

```
┌──res─┐
│ -100 │
└──────┘
```

## JSONExtractIntCaseInsensitive[​](#JSONExtractIntCaseInsensitive "Direct link to JSONExtractIntCaseInsensitive")

Introduced in: v25.8.0

Parses JSON and extracts a value of Int type using case-insensitive key matching. This function is similar to [`JSONExtractInt`](#JSONExtractInt).

**Syntax**

```
JSONExtractIntCaseInsensitive(json [, indices_or_keys]...)
```

**Arguments**

- `json` — JSON string to parse [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — Optional. Indices or keys to navigate to the field. Keys use case-insensitive matching [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns the extracted Int value, 0 if not found or cannot be converted. [`Int64`](/docs/sql-reference/data-types/int-uint)

**Examples**

**basic**

```
SELECT JSONExtractIntCaseInsensitive('{"Value": 123}', 'value')
```

```
123
```

**nested**

```
SELECT JSONExtractIntCaseInsensitive('{"DATA": {"COUNT": 42}}', 'data', 'Count')
```

```
42
```

## JSONExtractKeys[​](#JSONExtractKeys "Direct link to JSONExtractKeys")

Introduced in: v21.11.0

Parses a JSON string and extracts the keys.

**Syntax**

```
JSONExtractKeys(json[, indices_or_keys, ...])
```

**Arguments**

- `json` — JSON string to parse. [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — A list of zero or more arguments each of which can be either string or integer. [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns an array with the keys of the JSON object. [`Array(String)`](/docs/sql-reference/data-types/array)

**Examples**

**Usage example**

```
SELECT JSONExtractKeys('{"a": "hello", "b": [-100, 200.0, 300]}') AS res;
```

```
┌─res─────────┐
│ ['a','b']   │
└─────────────┘
```

## JSONExtractKeysAndValues[​](#JSONExtractKeysAndValues "Direct link to JSONExtractKeysAndValues")

Introduced in: v20.1.0

Parses key-value pairs from a JSON where the values are of the given ClickHouse data type.

**Syntax**

```
JSONExtractKeysAndValues(json[, indices_or_keys, ...], value_type)
```

**Arguments**

- `json` — JSON string to parse. [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — A list of zero or more arguments each of which can be either string or integer. [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)
- `value_type` — ClickHouse data type of the values. [`String`](/docs/sql-reference/data-types/string)

**Returned value**

Returns an array of tuples with the parsed key-value pairs. [`Array(Tuple(String, value_type))`](/docs/sql-reference/data-types/array)

**Examples**

**Usage example**

```
SELECT JSONExtractKeysAndValues('{"x": {"a": 5, "b": 7, "c": 11}}', 'Int8', 'x') AS res;
```

```
┌─res────────────────────┐
│ [('a',5),('b',7),('c',11)] │
└────────────────────────┘
```

## JSONExtractKeysAndValuesCaseInsensitive[​](#JSONExtractKeysAndValuesCaseInsensitive "Direct link to JSONExtractKeysAndValuesCaseInsensitive")

Introduced in: v25.8.0

Parses key-value pairs from JSON using case-insensitive key matching. This function is similar to [`JSONExtractKeysAndValues`](#JSONExtractKeysAndValues).

**Syntax**

```
JSONExtractKeysAndValuesCaseInsensitive(json [, indices_or_keys...], value_type)
```

**Arguments**

- `json` — JSON string to parse [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — Optional. Indices or keys to navigate to the object. Keys use case-insensitive matching [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)
- `value_type` — The ClickHouse data type of the values [`String`](/docs/sql-reference/data-types/string)

**Returned value**

Returns an array of tuples containing key-value pairs. [`Array(Tuple(String, T))`](/docs/sql-reference/data-types/array)

**Examples**

**basic**

```
SELECT JSONExtractKeysAndValuesCaseInsensitive('{"Name": "Alice", "AGE": 30}', 'String')
```

```
[('Name','Alice'),('AGE','30')]
```

## JSONExtractKeysAndValuesRaw[​](#JSONExtractKeysAndValuesRaw "Direct link to JSONExtractKeysAndValuesRaw")

Introduced in: v20.4.0

Returns an array of tuples with keys and values from a JSON object. All values are represented as unparsed strings.

**Syntax**

```
JSONExtractKeysAndValuesRaw(json[, indices_or_keys, ...])
```

**Arguments**

- `json` — JSON string to parse. [`String`](/docs/sql-reference/data-types/string)
- `indices_or_keys` — A list of zero or more arguments each of which can be either string or integer. [`String`](/docs/sql-reference/data-types/string) or [`(U)Int*`](/docs/sql-reference/data-types/int-uint)

**Returned value**

Returns an array of tuples with parsed key-value pairs where values are unparsed strings. [`Array(Tuple(String, String))`](/docs/sql-reference/data-types/array)

**Examples**

**Usage example**

```
SELECT JSONExtractKeysAndValuesRaw('{"a": [-100, 200.0], "b": "hello"}') AS res;
```

```
┌─res──────────────────────────────────┐
│ [('a','[-100,200.0]'),('b','"hello"')] │
└──────────────────────────────────────┘
```

## JSONExtractKeysAndValuesRawCaseInsensitive[​](#JSONExtractKeysAndValuesRawCaseInsensitive "Direct link to JSONExtractKeysAndValuesRawCaseInsensitive")

Introduced in: v25.8.0

Extracts raw key-value pairs from JSON using case-insensitive key matching. This function is similar to [`JSONExtractKeysAndValuesRaw`](#JSONExtractKeysAndValuesRaw).

**Syntax**

```
JSONExtractKeysAndValuesRawCaseInsensitive(json [, indices_or_keys]...)
```

**Arguments**