> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.unescape

> Decodes JSON string escape sequences from escaped string content or from a complete quoted JSON string literal. The input is parsed with the JSON string parser, not as a full JSON document.

<div className="real-function-page">
  ```lua theme={null}
  json.unescape(text: string): string
  ```

  ## Arguments

  <ParamField path={"text"} type={"string"} required>
    Escaped JSON string content, or a complete quoted JSON string literal whose first and last bytes are quotes. The function reads this argument with string type checking.
  </ParamField>

  ## Returns

  <ResponseField name={"text"} type={"string"}>
    Decoded string. Supported escapes include ", \\, /, \b, \f, \n, \r, \t, and \uXXXX with surrogate-pair handling. Invalid escapes, unescaped control characters, unterminated strings, and trailing characters after a quoted literal throw a Luau error with a near-position suffix.
  </ResponseField>

  ## Example

  Decode JSON string escapes from escaped content or a quoted JSON string literal.

  ```lua theme={null}
  local escaped = json.escape("Real Docs" .. string.char(10) .. "Docs")
  local restored = json.unescape(escaped)

  print(restored)
  ```
</div>
