Category
JSON
Parse, encode, inspect, and transform JSON.Category guide
Overview
Use this overview to understand the category before opening a specific function.- See what this group of functions is meant to solve.
- Compare function names and descriptions in one table.
- Open a function for syntax, arguments, returns, and examples.
JSON
Available functions
| Function | Description |
|---|---|
json.array | Marks a table as a JSON array so encoding keeps array semantics, including for empty tables. |
json.clone | Creates a deep JSON-compatible copy of a value without sharing nested table references. |
json.decode | Parses a JSON string and returns the matching Luau value. |
json.decodeSafe | Parses JSON without throwing and returns success, value, and error details. |
json.encode | Serializes a Luau value into JSON using optional formatting and encoding rules. |
json.encodePretty | Serializes a Luau value into readable formatted JSON. |
json.escape | Escapes text so it can safely appear inside a JSON string literal. |
json.format | Parses and re-encodes JSON to normalize formatting. |
json.getPath | Reads a nested value from a table using a dotted path or path array. |
json.isArray | Returns whether a value is marked or shaped as a JSON array. |
json.isNull | Returns whether a value is the JSON null sentinel. |
json.isObject | Returns whether a value is marked or shaped as a JSON object. |
json.keys | Returns the keys of a JSON object as an array table. |
json.minify | Removes unnecessary whitespace from JSON while preserving its value. |
json.object | Marks a table as a JSON object so encoding keeps object semantics. |
json.parse | Alias-style JSON parser that behaves like json.decode. |
json.pretty | Alias-style helper that serializes a value as formatted JSON. |
json.quote | Wraps and escapes text as a complete JSON string literal. |
json.stringify | Alias-style JSON serializer that behaves like json.encode. |
json.tryDecode | Attempts to parse JSON and returns structured error information instead of throwing. |
json.type | Returns the JSON-aware type of a value, including array, object, and null markers. |
json.unescape | Converts escaped JSON string content back into plain text. |
json.validate | Validates JSON and returns error details when parsing fails. |
json.values | Returns the values of a JSON object as an array table. |