---
title: SQLite JSON functions return SQL values as well as JSON text
slug: sqlite-json
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source: https://iinventedlight.com/library/notes/sqlite-json.md
source_license: Public domain
attribution: Original synthesis by iinventedlight, drafted by Librarian with AI assistance; based on the attributed sources
  below.
author: Librarian
client: Librarian
date: '2026-11-05'
checked_on: '2026-11-05'
as_of: '2026-11-05'
status: published
confidence: medium
category: coding-references
tags:
- sqlite
- json
untested: Reference note. No code or commands were run to validate behavior.
sources:
- id: S1
  title: JSON functions and operators
  publisher: SQLite authors
  url: https://www.sqlite.org/json1.html
  accessed: '2026-11-05'
  license: Public domain
  license_url: https://www.sqlite.org/copyright.html
  license_verified: '2026-11-05'
  green: true
  attribution: SQLite authors; JSON functions and operators; Public domain
  snapshot: _fetched/sqlite-json.txt
- id: S2
  title: Datatypes in SQLite
  publisher: SQLite authors
  url: https://www.sqlite.org/datatype3.html
  accessed: '2026-11-05'
  license: Public domain
  license_url: https://www.sqlite.org/copyright.html
  license_verified: '2026-11-05'
  green: true
  attribution: SQLite authors; Datatypes in SQLite; Public domain
  snapshot: _fetched/sqlite-types.txt
---
# SQLite JSON functions return SQL values as well as JSON text

## Summary
SQLite supports JSON through functions and operators rather than a separate SQL JSON storage class. JSON text fits into SQLite's existing value model. [S1, S2]

## Details
With one path, `json_extract` returns SQL scalars for scalar JSON values, including SQL NULL for JSON null. Arrays and objects are returned as JSON text. Multiple paths produce a JSON array in text form. `json_valid` checks a value against its selected rules; when its flags argument is omitted, it checks strict RFC-8259 text. SQLite JSONB is a separate binary representation described by the JSON documentation, not a new storage class. [S1, S2]

## Claims
- id: C1
  claim: "SQLite cannot add a separate JSON type to its existing value classes."
  source: S1
  evidence: "It is not possible to add a new \"JSON\" type"
- id: C2
  claim: "A single-path JSON null extraction returns SQL NULL."
  source: S1
  evidence: "NULL for a JSON null"
- id: C3
  claim: "SQLite associates a value type with the value rather than its container."
  source: S2
  evidence: "associated with the value itself, not with its container"

## Sources
- [S1] JSON functions and operators. SQLite authors. https://www.sqlite.org/json1.html. Public domain; license: https://www.sqlite.org/copyright.html. Accessed 2026-11-05.
- [S2] Datatypes in SQLite. SQLite authors. https://www.sqlite.org/datatype3.html. Public domain; license: https://www.sqlite.org/copyright.html. Accessed 2026-11-05.

## Attribution and notices
This note is CC BY 4.0. Source material has been condensed and restated; short evidence excerpts retain their source license.

SQLite code and documentation are dedicated to the public domain by their authors. This note is original synthesis.
