For simple array members like that, you can use JSON.parse.

var array = JSON.parse("[" + string + "]");

This gives you an Array of numbers.

[0, 1]

If you use .split(), you'll end up with an Array of strings.

["0", "1"]

Just be aware that JSON.parse will limit you to the supported data types. If you need values like undefined or functions, you'd need to use eval(), or a JavaScript parser.


If you want to use .split(), but you also want an Array of Numbers, you could use Array.prototype.map, though you'd need to shim it for IE8 and lower or just write a traditional loop.

var array = string.split(",").map(Number);
Answer from I Hate Lazy on Stack Overflow
🌐
CodingNomads
codingnomads.com › javascript-array-to-string-conversion
JavaScript Array-String Conversion
The output will be: Our team members are Alice, Bob, Charlie, and Dana. Next up, you'll be checking out the .split() method, which is like the inverse of .join(). It's used to convert a string to an array.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › string-to-array-in-javascript
JavaScript - Convert String to Array - GeeksforGeeks
August 5, 2025 - The Array.from() method can convert a string into an array of characters. This method is especially useful if you want to create an array from an iterable object, like a string, without needing to specify a separator.
Discussions

Convert string with commas to array - javascript
In this case alert shows 0,1. If it where an array, it would show 0. And if alert(array[1]) is called, it should pop-up 1 · Is there any chance to convert such string into a JavaScript array? More on stackoverflow.com
🌐 stackoverflow.com
Converting a String to an Array
🌐 r/godot
4
6
October 24, 2023
string to string array conversion in java - Stack Overflow
I have a string = "name"; I want to convert into a string array. How do I do it? Is there any java built in function? Manually I can do it but I'm searching for a java built in function. I want an... More on stackoverflow.com
🌐 stackoverflow.com
Convert string to an array
Im receiving a String like this: 200,200,219,204,200,200,197 I want to convert that into an array. My first approach is to add brackets to both ends giving me a list like this: [200,200,219,204,200,200,197] String msg = "["; for (int i = 6; i More on forum.arduino.cc
🌐 forum.arduino.cc
0
0
June 2, 2023
🌐
W3Schools
w3schools.com › java › java_howto_string_to_array.asp
Java How To Convert a String to an Array
Explanation: The method toCharArray() turns the string into an array of characters.
🌐
freeCodeCamp
freecodecamp.org › news › string-to-array-in-java-how-to-convert-a-string-to-an-array-in-java
String to Array in Java – How to Convert Strings to Arrays
July 6, 2023 - This method splits the string into individual characters and returns an array containing those characters. Store the resulting character array in the variable charArray. Iterate over the charArray using a for-each loop to print each character ...
🌐
Flexiple
flexiple.com › javascript › string-to-array-javascript
Converting string to array JavaScript? - Flexiple Tutorials - Flexiple
March 11, 2022 - If no delimiter is passed the entire string is returned as one element in an array and if an empty string "" is passed, the string splits each character and an array. ... Handpicked opportunities with top companies for full-time and contract jobs.Join today for freeJoin today for free
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Web › JavaScript › Reference › Global_Objects › String › split
String.prototype.split() - JavaScript - MDN Web Docs
If separator does not occur in str, the returned array contains one element consisting of the entire string. If separator is an empty string (""), str is converted to an array of each of its UTF-16 "characters", without empty strings on either ends of the resulting string.
Find elsewhere
🌐
arrayThis
arraythis.com
Online array converter; convert your text list to array | arrayThis
Instantly convert your text list to array using arrayThis online tool; valid arrays for JS, PHP, PERL, Python and much more.
🌐
Baeldung
baeldung.com › home › java › java string › array to string conversions
Array to String Conversions | Baeldung
June 9, 2025 - The StringUtils class has several StringUtils.join() methods that can be used to change an array of strings into a single string:
🌐
Reddit
reddit.com › r/godot › converting a string to an array
r/godot on Reddit: Converting a String to an Array
October 24, 2023 -

I have a string that is something like ["Value1","Value2","Value3"]. I would like to convert this to an array. I'd like to know if there is an easy way to convert that is effectively an array in String format into an actual array.

I'd prefer to avoid making a big loop that inserts the values from the string into a new array with find and substr but if that's required then that can be done.

🌐
DigitalOcean
digitalocean.com › community › tutorials › java-string-array-to-string
Java String Array to String | DigitalOcean
August 3, 2022 - Below image shows the output produced by the above program. The reason for the above output is because toString() call on the array is going to Object superclass where it’s implemented as below. public String toString() { return getClass().getName() + "@" + Integer.toHexString(hashCode()); }
🌐
DEV Community
dev.to › sanchithasr › 6-ways-to-convert-a-string-to-an-array-in-javascript-1cjg
6 Ways to Convert a String to an Array in JavaScript - DEV Community
September 24, 2022 - Converting from string to array is always done using the split() method but after ES6, there are many tools we could do the same.
🌐
CoreUI
coreui.io › answers › how-to-convert-a-string-to-an-array-in-javascript
How to convert a string to an array in JavaScript · CoreUI
September 22, 2025 - Use the split() method to convert a string into an array of characters or words in JavaScript efficiently.
🌐
W3Schools
w3schools.com › jsref › jsref_split.asp
JavaScript String split() Method
let text = "How are you doing today?"; const myArray = text.split(" "); let word = myArray[1]; Try it Yourself » ... More examples below. The split() method splits a string into an array of substrings.
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Convert string to an array - Programming - Arduino Forum
June 2, 2023 - Im receiving a String like this: 200,200,219,204,200,200,197 I want to convert that into an array. My first approach is to add brackets to both ends giving me a list like this: [200,200,219,204,200,200,197] String msg = "["; for (int i = 6; i
🌐
w3resource
w3resource.com › PostgreSQL › postgresql_string_to_array-function.php
PostgreSQL STRING_TO_ARRAY() function - w3resource
July 30, 2024 - The STRING_TO_ARRAY() function in PostgreSQL splits a string into an array using a specified delimiter.
🌐
n8n
community.n8n.io › questions
How to convert a string to an array of strings? - Questions - n8n Community
March 5, 2021 - Hey! How to convert a string to an array of strings like this example?