Script for backward-compatibility: https://github.com/douglascrockford/JSON-js/blob/master/json2.js

And call:

var myJsonString = JSON.stringify(yourArray);

Note: The JSON object is now part of most modern web browsers (IE 8 & above). See caniuse for full listing. Credit goes to: @Spudley for his comment below

Answer from JonoW on Stack Overflow
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_json_stringify.asp
JSON.stringify()
Use the JavaScript function JSON.stringify() to convert it into a string. ... The result will be a string following the JSON notation. myJSON is now a string, and ready to be sent to a server: const obj = {name: "John", age: 30, city: "New York"}; ...
Discussions

java - Converting from JSONArray to String then back again - Stack Overflow
I need to store a JSONArray object as a string then retrieve the string and convert it back to a JSONArray. More on stackoverflow.com
๐ŸŒ stackoverflow.com
java - Convert string to JSON array - Stack Overflow
I have the following string of a JSON from a web service and am trying to convert this to a JSONarray More on stackoverflow.com
๐ŸŒ stackoverflow.com
java - Convert JSONArray to String Array - Stack Overflow
Why would you want to convert a JSONArray which you showed to an ArrayList or an Array.Any special use? ... Take a look at this tutorial. Also you can parse above json like : JSONArray arr = new JSONArray(yourJSONresponse); List list = new ArrayList(); for(int i = 0; i < ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Convert JSON string to array of JSON objects in Javascript - Stack Overflow
Append extra an [ and ] to the beginning and end of the string. This will make it an array. Then use eval() or some safe JSON serializer to serialize the string and make it a real JavaScript datatype. More on stackoverflow.com
๐ŸŒ stackoverflow.com
People also ask

Is TableConvert really free to use?
Yes, TableConvert is completely free! All converter features, table editor, data generator tools, and export options are available without cost, registration, or hidden fees. Convert unlimited files online for free.
๐ŸŒ
tableconvert.com
tableconvert.com โ€บ home โ€บ convert json array to json array online
Convert JSON Array to JSON Array Online - Table Convert
Is my data secure when using this online converter?
Absolutely! All table conversions happen locally in your browser - your data never leaves your device. Our online converter processes everything client-side, ensuring complete privacy and data security. No files are stored on our servers.
๐ŸŒ
tableconvert.com
tableconvert.com โ€บ home โ€บ convert json array to json array online
Convert JSON Array to JSON Array Online - Table Convert
What file size limits does the online converter have?
Our free online table converter supports files up to 10MB. For larger files, batch processing, or enterprise needs, use our browser extension or professional API service with higher limits.
๐ŸŒ
tableconvert.com
tableconvert.com โ€บ home โ€บ convert json array to json array online
Convert JSON Array to JSON Array Online - Table Convert
๐ŸŒ
ReqBin
reqbin.com โ€บ code โ€บ javascript โ€บ n2ek7onb โ€บ javascript-array-to-json-example
How do I convert JavaScript array to JSON?
July 27, 2023 - To convert a JavaScript array to a JSON data string, you can use the JSON.stringify(value, replacer, space) method. The optional replacer parameter is a function that can alter the behavior of the serialization process.
๐ŸŒ
Table Convert
tableconvert.com โ€บ home โ€บ convert json array to json array online
Convert JSON Array to JSON Array Online - Table Convert
July 28, 2025 - Convert JSON to JSON online โ€” JSON to JSON converter built for fast table conversion. ... Upload JSON files or paste JSON arrays. Supports automatic recognition and parsing of object arrays, nested structures, and complex data types.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ JSON โ€บ stringify
JSON.stringify() - JavaScript - MDN Web Docs
The JSON.stringify() static method converts a JavaScript value to a JSON string, optionally replacing values if a replacer function is specified or optionally including only the specified properties if a replacer array is specified.
๐ŸŒ
Blogger
javarevisited.blogspot.com โ€บ 2013 โ€บ 04 โ€บ convert-json-array-to-string-array-list-java-from.html
How to Convert JSON array to String array in Java - GSon example
Java programming tutorial to convert JSON array to String array with example, by using Gson library. Though you can also use other open source library, Gson seems easy to me.
Find elsewhere
๐ŸŒ
Jsontostring
jsontostring.com
Convert JSON to String Online
Convert JSON to String Online with our tool. Our Javascript Object to String Converter can convert multiline content with full accuracy online.
๐ŸŒ
W3Schools
w3schools.com โ€บ js โ€บ js_json_parse.asp
JSON.parse()
When using the JSON.parse() on a JSON derived from an array, the method will return a JavaScript array, instead of a JavaScript object. const text = '["Ford", "BMW", "Audi", "Fiat"]'; const myArr = JSON.parse(text); Try it Yourself ยป ยท Date objects are not allowed in JSON. If you need to include a date, write it as a string. You can convert it back into a date object later: Convert a string into a date: const text = '{"name":"John", "birth":"1986-12-14", "city":"New York"}'; const obj = JSON.parse(text); obj.birth = new Date(obj.birth); document.getElementById("demo").innerHTML = obj.name + ", " + obj.birth; Try it Yourself ยป ยท
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ how-to-convert-json-string-to-array-of-json-objects-using-javascript
Convert JSON String to Array of JSON Objects in JavaScript | GeeksforGeeks
December 4, 2024 - Converting a JavaScript object to a JSON string means using the JSON.stringify() method to transform the object into a JSON-formatted string. This allows for efficient data storage, transmission, and debugging by representing complex data structures ...
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ javascript-convert-an-array-to-json
Convert an Array to JSON in JavaScript | GeeksforGeeks
October 7, 2024 - This method converts the javascript Object(array in this case) into JSON_string. ... Example 1: This example converts the JS array to JSON String using JSON.stringify() method.
๐ŸŒ
Quora
quora.com โ€บ How-do-you-convert-a-JSON-object-into-a-String-Array
How to convert a JSON object into a String Array - Quora
A JavaScript object or value is converted to a JSON string using the JSON.stringify() method, with the option to replace values if a replacer function or replacer array is given, or to include only the specified attributes otherwise.
๐ŸŒ
Codedamn
codedamn.com โ€บ news โ€บ javascript
How to convert an array to a JSON object
November 18, 2022 - We can also see that the data type of the object has been converted to a string. To convert the JSON data to the actual data i.e object, array, etc we can use the parse() method which works exactly reverse to that of the stringify() method.
๐ŸŒ
MDN Web Docs
developer.mozilla.org โ€บ en-US โ€บ docs โ€บ Web โ€บ JavaScript โ€บ Reference โ€บ Global_Objects โ€บ JSON โ€บ parse
JSON.parse() - JavaScript - MDN Web Docs
Because JSON has no syntax space for annotating type metadata, in order to revive values that are not plain objects, you have to consider one of the following: Serialize the entire object to a string and prefix it with a type tag. "Guess" based on the structure of the data (for example, an ...
Top answer
1 of 6
2

The problem is not the JSONArray.toString(), as @Selvin mentioned.

From JSONArray source:

/**
 * Encodes this array as a compact JSON string, such as:
 * <pre>[94043,90210]</pre>
 */
@Override public String toString() {
    try {
        JSONStringer stringer = new JSONStringer();
        writeTo(stringer);
        return stringer.toString();
    } catch (JSONException e) {
        return null;
    }
}

/**
 * Encodes this array as a human readable JSON string for debugging, such
 * as:
 * <pre>
 * [
 *     94043,
 *     90210
 * ]</pre>
 *
 * @param indentSpaces the number of spaces to indent for each level of
 *     nesting.
 */
public String toString(int indentSpaces) throws JSONException {
    JSONStringer stringer = new JSONStringer(indentSpaces);
    writeTo(stringer);
    return stringer.toString();
}

The problem is that you need to convert your ChecklistAnswer to JSON object first for your JSONArray to work properly.

Again from Javadoc:

/**
 * A dense indexed sequence of values. Values may be any mix of
 * {@link JSONObject JSONObjects}, other {@link JSONArray JSONArrays}, Strings,
 * Booleans, Integers, Longs, Doubles, {@code null} or {@link JSONObject#NULL}.
 * Values may not be {@link Double#isNaN() NaNs}, {@link Double#isInfinite()
 * infinities}, or of any type not listed here.

...

2 of 6
1

In my ChecklistAnwer class i added:

   public JSONObject toJsonObject(){
    JSONObject json = new JSONObject();

    try {
        json.put("questionId", questionId);
        json.put("checklistId", checklistId);
        json.put("answer", answer);
        json.put("remark", remark);
    } catch (JSONException e) {
        e.printStackTrace();
    }

    return json;
}

and in my other class:

JSONArray answers = new JSONArray();

ChecklistAnswer answer = new ChecklistAnswer(questions.get(id).id, 2, cb.isChecked(),         text.getText().toString());

answers.put(answer.toJsonObject());

if i filled the array:

String js = answers.toString(1);

and that returns:

[
 {
  "answer": true,
  "questionId": 1,
  "remark": "",
  "checklistId": 2
 },
 {
  "answer": false,
  "questionId": 4,
  "remark": "teesxfgtfghyfj",
  "checklistId": 2
 },
 {
  "answer": true,
  "questionId": 4,
  "remark": "",
  "checklistId": 2
 },
 {
  "answer": true,
  "questionId": 4,
  "remark": "",
  "checklistId": 2
 },
 {
  "answer": true,
  "questionId": 4,
  "remark": "",
  "checklistId": 2
 },
 {
  "answer": true,
  "questionId": 4,
  "remark": "",
  "checklistId": 2
 },
 {
  "answer": true,
  "questionId": 4,
  "remark": "",
  "checklistId": 2
 }
]

thanks to @Selvin