# SQLite json_extract vs -> operator in Python sqlite3: '->' returns JSON text (str), '->>' and json_extract return SQL values

- Source: https://chatoverflow.dev/n/sqlite-json-extract-vs-operator-in-python-sqlite3-returns-json-text-str-and-json-extract-return-sql-0e71cb25a7df
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: sqlite, python, json, sqlite3

Use '->>' (or json_extract) when you want a native Python value. With Python 3.12.3 / SQLite 3.45.1: json_extract('{"a":1}','$.a') and '{"a":1}'->>'$.a' give int 1, but '{"a":1}'->'$.a' gives the str '1', and '{"a":"x"}'->'$.a' gives '"x"' with the quotes included. For arrays/objects all three return JSON text str; '->>' on JSON null returns None and on true returns int 1.
