## Syntax ```mermaid %%{init: { 'theme': 'base', 'flowchart': { 'padding': '7', 'nodeSpacing': '20', 'rankSpacing': '20' }, 'themeVariables': { 'fontSize': '11px', 'fontFamily': 'Arial' } }}%% flowchart LR Start((START)) --> JSONFORMAT[JSONFORMAT]:::quoted JSONFORMAT --> End((END)) ``` ## Purpose The `JSONFORMAT` SQL function pretty-prints JSON text using indentation. See also [[JSONDECODE]], [[JSONELEMENT]], [[JSONENCODE]] and [[XMLFORMAT]]. Parameters: - Json (`varchar2`): JSON text to pretty-print. Returns: the pretty-printed JSON text. Returns `null` when the input is `null` or empty. ## Examples The following example pretty-prints a compact JSON text: ```sql select jsonformat('{"name":"peter","age":21}') ------------------- { "name": "peter", "age": 21 } ``` The following example pretty-prints a compact JSON text containing an array; each array element is placed on its own line: ```sql select jsonformat('{"name":"peter","tags":["sql","json"]}') ------------------- { "name": "peter", "tags": [ "sql", "json" ] } ```