> For the complete documentation index, see [llms.txt](https://200ok.gitbook.io/200ok-documents/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://200ok.gitbook.io/200ok-documents/user-manual/built-in-functions/advanced/tojson.md).

# toJson

toJson() function is the Standard function available in 200OK.

**Description** : The fx\_toJson function serializes a JSON string into a pretty-print format.

**Syntax** : fx\_toJson(string)

**Example** : fx\_toJson('id1':'hi','id2':'world') would convert the input JSON string into a more readable and structured format.

Here we go with simple scenario using the above function.

**Request Side** :&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/nI30cUs1NHCyFZeqxKI8cuphfBfGLqJoQl_El0xJMHy4ozyUEH4v0KDIigHY3y6mxzwUFjDd9BMPg82Xn6_eT0A3j2_hBRFA5A5tSTjtK_OofH35QspqZeQ4FJZP3o6KI3RNdlKSJWnzMRrNTZx7AXI" alt=""><figcaption></figcaption></figure>

**Response Side** :&#x20;

<figure><img src="https://lh7-us.googleusercontent.com/GY2A8vT1hsIi_nw7EWRd5jeKnTk8QOcf2T1X-rSvSYfFnKqP-2RUGtnA1233NoikkssHitdWrKF2-cCxiejJVFclLbsFrKYvctXWUUn_RMV0A4VCK2X21Wjf4jVTsTrFhEBeWRrWQS2ZriJxWrAOC14" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/59wiOiWKO9X9VtrLJfVcqT3tDUAmu30SeiVLFc8pybZaplvi4TBfP1w9FcY9GOxkQ59aFYIkbqRBsLzkX4IYDPdbyeWY5V7oKj1KAO8J3GLJpjfSLO18YEXaBbe1Qt6FP6htBg9OQZtxOZ9yCLwVYL0" alt=""><figcaption></figcaption></figure>
