---
name: "fromJSON"
type: command
status: ok
groups: ["Strings"]
arma3_since: "2.18"
locality: {"argument": null, "effect": null, "server_exec": false}
source: https://community.bistudio.com/wiki/fromJSON
revid: 373363
updated: 2025-04-29T02:36:28Z
---

# fromJSON

*Command · Strings · Arma 3 v2.18*

## Description

Obtain the game value from the provided [JSON](https://en.wikipedia.org/wiki/JSON)-formatted string.

## Syntax

```sqf
fromJSON jsonValue
```

**Parameters:**

- `jsonValue`: [String](../topics/String.md) - JSON data

**Returns:** Can be one of:
- [HashMap](../topics/HashMap.md)
- [Array](../topics/Array.md)
- [Number](../topics/Number.md)
- [String](../topics/String.md)
- [Boolean](../topics/Boolean.md)
- [nil](../commands/nil.md)

## Examples

### Example 1

```sqf
private _myNumber = fromJSON "42";                                            // _myNumber is 42
private _myString = fromJSON """Hello there""";                                // _myString is "Hello there"
private _myArray = fromJSON "[42, ""Hello there"", true]";                    // _myArray is [42, "Hello there", true]
private _myHash = fromJSON "{""key1"": ""value1"", ""key2"": ""value2""}"    // _myHash is [["key2", "value2"], ["key1", "value1"]]

// Important: [] indicates array, {} and : indicates hash
```

## See also

[toJSON](../commands/toJSON.md) · [parseSimpleArray](../commands/parseSimpleArray.md)

<sub>Source: [BI Community Wiki — fromJSON](https://community.bistudio.com/wiki/fromJSON) (revision 373363).</sub>
