Instead of using JSONObject you may use JSONArray. If you really need to convert it to a List you may do something like:

List<JSONObject> list = new ArrayList<JSONObject>();
try {
    int i;
    JSONArray array = new JSONArray(string);
    for (i = 0; i < array.length(); i++)
        list.add(array.getJSONObject(i);
} catch (JSONException e) {
    System.out.println(e.getMessage());
}
Answer from Victor Dodon on Stack Overflow
🌐
Mkyong
mkyong.com › home › java › how to parse json array with jackson
How to parse JSON Array with Jackson - Mkyong.com
April 23, 2024 - package com.mkyong.json.jackson; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.ObjectMapper; import com.mkyong.json.model.Person; import java.util.List; public class JsonArrayToObjectExample { public static void main(String[] args) throws JsonProcessingException { String jsonArray = "[{\"name\":\"mkyong\", \"age\":42}, {\"name\":\"ah pig\", \"age\":20}]"; ObjectMapper mapper = new ObjectMapper(); // 1.
Top answer
1 of 7
122

You can use json2csharp.com to Convert your json to object model

  • Go to json2csharp.com
  • Past your JSON in the Box.
  • Clik on Generate.
  • You will get C# Code for your object model
  • Deserialize by var model = JsonConvert.DeserializeObject<RootObject>(json); using NewtonJson

Here, It will generate something like this:

public class MatrixModel
{
    public class Option
    {
        public string text { get; set; }
        public string selectedMarks { get; set; }
    }

    public class Model
    {
        public List<Option> options { get; set; }
        public int maxOptions { get; set; }
        public int minOptions { get; set; }
        public bool isAnswerRequired { get; set; }
        public string selectedOption { get; set; }
        public string answerText { get; set; }
        public bool isRangeType { get; set; }
        public string from { get; set; }
        public string to { get; set; }
        public string mins { get; set; }
        public string secs { get; set; }
    }

    public class Question
    {
        public int QuestionId { get; set; }
        public string QuestionText { get; set; }
        public int TypeId { get; set; }
        public string TypeName { get; set; }
        public Model Model { get; set; }
    }

    public class RootObject
    {
        public Question Question { get; set; }
        public string CheckType { get; set; }
        public string S1 { get; set; }
        public string S2 { get; set; }
        public string S3 { get; set; }
        public string S4 { get; set; }
        public string S5 { get; set; }
        public string S6 { get; set; }
        public string S7 { get; set; }
        public string S8 { get; set; }
        public string S9 { get; set; }
        public string S10 { get; set; }
        public string ScoreIfNoMatch { get; set; }
    }
}

Then you can deserialize as:

var model = JsonConvert.DeserializeObject<List<MatrixModel.RootObject>>(json);
2 of 7
7
public static class Helper
{
    public static string AsJsonList<T>(List<T> tt)
    {
        return new JavaScriptSerializer().Serialize(tt);
    }
    public static string AsJson<T>(T t)
    {
        return new JavaScriptSerializer().Serialize(t);
    }
    public static List<T> AsObjectList<T>(string tt)
    {
        return new JavaScriptSerializer().Deserialize<List<T>>(tt);
    }
    public static T AsObject<T>(string t)
    {
        return new JavaScriptSerializer().Deserialize<T>(t);
    }
}
🌐
Baeldung
baeldung.com › home › json › jackson › convert json array to java list
Convert JSON Array to Java List | Baeldung
August 13, 2025 - We can specify the type of the target List using the TypeToken class. In the above example, we’ve defined the target type as List<Product>. Then, we use the fromJson() method of the Gson object to convert the JSON array String to a List.
🌐
Stleary
stleary.github.io › JSON-java › org › json › JSONObject.html
JSONObject
The values can be any of these types: Boolean, JSONArray, JSONObject, Number, String, or the JSONObject.NULL object. A JSONObject constructor can be used to convert an external form JSON text into an internal form whose values can be retrieved with the get and opt methods, or to convert values into a JSON text using the put and toString methods.
🌐
TutorialsPoint
tutorialspoint.com › how-can-we-convert-a-json-array-to-a-list-using-jackson-in-java
How can we convert a JSON array to a list using Jackson in Java?\\n
June 5, 2025 - We can convert a JSON array to a list using the ObjectMapper class. It has a useful method, readValue(), which takes a JSON string and converts it to the object class specified in the second argument.
Find elsewhere
🌐
Baeldung
baeldung.com › home › json › getting a value in jsonobject
Getting a Value in JSONObject | Baeldung
May 5, 2025 - First, when the value of a key is of JSONObject or JSONArray type, we need to propagate the recursive search down in that value. Second, when the key is found in the current recursive call, we need to add its mapped value to the returned result, regardless of whether the value is of a primitive type or not. ... public List<String> getValuesInObject(JSONObject jsonObject, String key) { List<String> accumulatedValues = new ArrayList<>(); for (String currentKey : jsonObject.keySet()) { Object value = jsonObject.get(currentKey); if (currentKey.equals(key)) { accumulatedValues.add(value.toString())
🌐
Stack Exchange
salesforce.stackexchange.com › questions › 375426 › json-array-string-into-list
apex - JSON Array String into List - Salesforce Stack Exchange
May 6, 2022 - String stringJSON = '[{"action":"ASSIGN","value":"Router"},{"action":"DISABLE","value":true},{"action":"HIDE","value":false}]'; List<Object> listOfAny = (List<Object>) JSON.deserializeUntyped(stringJSON); List<Map<String, Object>> listMap = new List<Map<String, Object>>(); for(Object obj : listOfAny) { Map<String, Object> mapObj = (Map<String, Object>) obj; listMap.add(mapObj); } System.debug(listMap); // Example: Get the two maps 'action' and 'value' from the list index 1 System.debug(listMap[1].get('action')); System.debug(listMap[1].get('value')); ... Find the answer to your question by asking.
🌐
Stack Overflow
stackoverflow.com › questions › 47735933 › converting-a-jsonobject-to-a-list-of-strings
android - Converting a JsonObject to a list of strings - Stack Overflow
String restaurantName; JsonElement restaurantJSONElement; JsonPrimitive restaurantJSONPrimitive; JsonParser parser = new JsonParser(); // buffer is the StringBuffer read JsonElement parentJSONElement = parser.parse(String.valueOf(buffer)); JsonObject parentJSONObject = parentJSONElement.getAsJsonObject(); //this is where is crashes I assume its because it cant convert the JsonElement to a JsonObject JsonArray restaurantsJSONArray = (JsonArray) parentJSONObject.get("restaurants"); List<String> restaurantnamelist1 = new ArrayList<String>(); { for (int i = 0; i < 1; i++) { //get the element resta
🌐
Stack Abuse
stackabuse.com › converting-json-array-to-a-java-array-or-list
Convert JSON Array to a Java Array or List with Jackson
September 8, 2020 - We don't always deal with JSON in String format. Oftentimes, the contents come from a File. Thankfully, Jackson makes this task as easy as the last one, we just provide the File to the readValue() method: final ObjectMapper objectMapper = new ObjectMapper(); List<Language> langList = objectMapper.readValue( new File("langs.json"), new TypeReference<List<Language>>(){}); langList.forEach(x -> System.out.println(x.toString()));
🌐
Baeldung
baeldung.com › home › java › java list › converting a java list to a json array
Converting a Java List to a Json Array | Baeldung
June 18, 2025 - In the above code snippet, we create an instance of the JSONArray class, passing the articles List as a parameter. The JSONArray class provides a toString() method to obtain the JSON array as a string representation.
🌐
Android Developers
developer.android.com › api reference › jsonobject
JSONObject | API reference | Android Developers
Skip to main content · English · Deutsch · Español – América Latina · Français · Indonesia · Polski · Português – Brasil · Tiếng Việt · 中文 – 简体