{
  "schema_version": 2,
  "id": "commands/json.type",
  "title": "JSON.TYPE",
  "url": "https://redis.io/docs/latest/commands/json.type/",
  "summary": "Returns the type of the JSON value at path",
  "since": "1.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:58+01:00",
  "page_type": "content",
  "content_hash": "2f3b03a76c33d70878fd9dbca5c772f08549446f91565efb14eac2eec0d4838d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Report the type of JSON value at `path`\n\nThe returned type is one of the following strings:\n\n| Type | Description |\n|:-----|:------------|\n| `null` | A JSON null value. |\n| `boolean` | A JSON `true` or `false` value. |\n| `integer` | A number with no fractional part. |\n| `number` | A number with a fractional part (a floating-point value). <sup>[1](#table-note-1)</sup>|\n| `string` | A JSON string value. |\n| `object` | A JSON object (a collection of key-value pairs). |\n| `array` | A JSON array (an ordered list of values). |\n\n1. <a name=\"table-note-1\"></a>\nA floating-point homogeneous array (FPHA) stored with the [`JSON.SET`](https://redis.io/docs/latest/commands/json.set) `FPHA` argument still reports as `array`, and its elements report as `number`. The FP type (`FP16`, `BF16`, `FP32`, or `FP64`) is an internal storage representation and is not exposed by `JSON.TYPE`.\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary> \n\nis key to parse.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>path</code></summary> \n\nis JSONPath to specify. Default is root `$`. Returns null if the `key` or `path` do not exist.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> JSON.SET doc $ '{\"a\":2, \"nested\": {\"a\": true}, \"foo\": \"bar\"}'\nOK\nredis> JSON.TYPE doc $..foo\n1) \"string\"\nredis> JSON.TYPE doc $..a\n1) \"integer\"\n2) \"boolean\"\nredis> JSON.TYPE doc $..dummy\n(empty array)"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nWith `$`-based path argument: [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings), where each element is the type of the matching value.\n\nWith `.`-based path argument: [Bulk string reply](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) representing the type of the matching value.\n\n**RESP3:**\n\nWith `$`-based path argument (default): [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [array replies](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings), where each nested array contains the type of the matching value.\n\nWith `.`-based path argument: [Array reply](https://redis.io/docs/latest/develop/reference/protocol-spec#arrays) of [bulk string replies](https://redis.io/docs/latest/develop/reference/protocol-spec#bulk-strings) representing the type of the matching value."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`JSON.SET`](https://redis.io/docs/latest/commands/json.set) | [`JSON.ARRLEN`](https://redis.io/docs/latest/commands/json.arrlen)"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "* [RedisJSON](https://redis.io/docs/latest/develop/data-types/json)\n* [Index and search JSON documents](https://redis.io/docs/latest/develop/ai/search-and-query/indexing)"
    }
  ],
  "examples": []
}
