> Agent-readable docs index: /llms.txt. Download /docs.zip to grep all markdown files locally.

---
title: json
description: JSON encode and decode utilities
icon: braces
---

The `json` namespace converts between Lua values and JSON text.

## parse

```lua
json.parse(json_text: string): any
```

> Deserializes any UTF-8 JSON string into a Lua value or table.

<Schema title="Parameters">
  <SchemaField name="json_text" type="string" required>
    UTF-8 JSON text.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="value" type="any">
    The decoded Lua value or table.
  </SchemaField>
</Schema>

## stringify

```lua
json.stringify(value: any): string
```

> Serializes a Lua value into a string containing its JSON representation.

<Schema title="Parameters">
  <SchemaField name="value" type="any" required>
    A Lua boolean, number, string, table, or `nil`.
  </SchemaField>
</Schema>

<Schema title="Returns">
  <SchemaField name="json_text" type="string">
    The JSON-encoded string.
  </SchemaField>
</Schema>
