{e1,e2,…}
is a list of elements.
List 
{e1,e2,…}
is a list of elements.
Details
- Lists are very general objects that represent collections of expressions.
- Functions with attribute Listable are automatically "threaded" over lists, so that they act separately on each list element. Most built‐in mathematical functions are Listable.
- {a,b,c} represents a vector.
- {{a,b},{c,d}} represents a matrix.
- Nested lists can be used to represent tensors.
- If Nothing appears in a list, it is automatically removed.
- Parallelize[{e1,e2,…}] evaluates the elements e1, e2, … in parallel. »
Background & Context
- List is a very general construct used to represent collections of expressions. Lists may have any length or depth. The expression List[a,b,c,…] is commonly written and displayed using the shorthand syntax {a,b,c,…}. Lists are particularly important in the Wolfram Language, which does not define explicit vector, matrix, tensor, etc. objects but rather uses (possibly nested) lists to represent such structures. For example, {a,b,c,…} can represent a vector, {{a,b},{c,d}} a matrix, and so on.
- Functions with attribute Listable are automatically “threaded” over lists, meaning they act separately on each list element. Most built‐in mathematical functions are Listable.
- Apply replaces the head of a List (or any other expression) with a new head, while Map applies a function to elements on the first level of a List (or any other expression).
- SparseArray may be used to efficiently represent and compute with lists (or nested lists) that have a constant (often 0) “background” value. A SparseArray can be expanded to a full-dimensional List using Normal.
- Values of a list can be efficiently modified in place using Set, e.g. list[[k]]=newValue. Common operations to access, insert, or delete elements of a list include Part, Take, Drop, Extract, Insert, Delete, PadLeft/PadRight, Append/AppendTo, and Prepend/PrependTo.
- A flat list of values (i.e. a vector) may be plotted using ListPlot, and an array of values given by a rectangular list of lists may be plotted using ArrayPlot, MatrixPlot, ListDensityPlot, or related functions. Other important and useful functions commonly applied to lists include Total, Accumulate, Mean, and ListConvolve.
- Association provides a generalization of symbolically indexed lists, associative arrays, dictionaries, hashmaps, structs, and a variety of other powerful data structures. An Association is so named because it associates keys with values, allowing highly efficient lookup and updating even with millions of elements.
- A list can be converted to a sequence of expressions by applying Sequence to it. This can be particularly useful since functions in the Wolfram Language often take a flat sequence of arguments instead of an argument list, so use of Sequence allows list-represented data to be easily spliced into other functions.
Examples
open all close allBasic Examples (1)
Scope (31)
Representation of Vectors, Matrices, and Other Arrays (4)
A vector is a list of nonlist elements:
v = {1, 2.3, x + 4};VectorQ[v]Many operations work on vectors, like Dot and Norm:
v.vA matrix is a list of vectors of equal length:
m = {{1, 2, 3}, {1, 4, 9}};MatrixQ[m]Many operations work with matrices, like Dot, Transpose, and Det:
m.Transpose[m]Det[Transpose[m].m]A rectangular array is represented by nested lists with consistent dimensions:
ra = {{{1, 2, 3}, {4, 5, 6}}, {{7, 8, 9}, {10, 11, 12}}, {{13, 14, 15}, {16, 17, 18}}, {{19, 20, 21}, {22, 23, 24}}};ArrayQ[ra]Many operations work on arrays of any depth, like Dot and Fourier:
ra.{1, 2, 3}The three-dimensional discrete Fourier transform:
Fourier[ra]Ragged arrays that are not rectangular can also be used:
ragged = {{1, 2, 3}, {4, 5}, {6}};Many structural functions will work with ragged arrays:
ragged[[All, 1]]Map[Total, ragged]If the elements are at the same depth, you can use PadRight to make a rectangular array:
PadRight[ragged]Constructing Lists (5)
Range constructs a list consisting of a range of values:
Range[4]Range[4, -4, -2]Range[0., 1., .1]Array constructs lists using a function:
Array[f, 4]Array[2 ^ #&, 4]When given multiple dimensions, matrices or deeper arrays are constructed:
h[i_, j_] := 1 / (i + j - 1);
Array[h, {4, 3}]Table constructs lists using an expression and an iterator:
Table[f[i], {i, 4}]Table[2 ^ i, {i, -4, 4}]When given multiple iterators, matrices and arrays can be constructed:
h[i_, j_] := 1 / (i + j - 1);Table[h[i, j], {i, 4}, {j, 3}]Table[h[i, j], {i, 4}, {j, i}]Functional commands like NestList create lists of the results:
NestList[3#(1 - #)&, .1, 20]ListPlot[%, Filling -> Axis]To construct a list when the length is not known ahead of time, Sow and Reap are efficient:
rolls := Module[{prev = 0, next, r6 = Range[6]}, Reap[
While[(next = RandomChoice[r6]) ≠ prev,
Sow[next];prev = next]][[2, 1]]]Some trials of rolling a die until the same number comes up twice in a row:
rollsrollsrollsListable Functions (4)
{1, 2, 3} + {a, b, c}2 * {1, 2, 3}Sin[2 Pi Range[0., 1., 1 / 13]]a * {{1, 2}, {3, 4}}Matrix plus a vector adds the component of the vector to the rows of the matrix:
{{1, 2}, {3, 4}} + {a, b}Function applied element-wise to a matrix:
Exp[{{1., 2., 3.}, {4., 5., 6.}}]Any function that has the Listable attribute will thread over lists element-wise:
SetAttributes[f, Listable]f[{1, 2, 3, 4}]Use Threaded to alter how listable functions combine arguments:
{{1, 2}, {3, 4}} + {a, b}{{1, 2}, {3, 4}} + Threaded[{a, b}]Operations on List Elements (5)
Apply makes the elements of a list the arguments of a function:
Apply[f, {1, 2, 3}]If you have a nested list, applying at level 1 gives a list f applied to the sublists:
Apply[f, {{1, 2}, {3, 4}, {5, 6}}, {1}]Map applies a function to the elements of a list:
Map[f, {1, 2, 3, 4}]For a nested list, Map can apply f at any level or multiple levels:
Map[f, {{1, 2}, {3, 4}, {5, 6}}, {2}]Map[f, {{1, 2}, {3, 4}, {5, 6}}, 2]Do, Product, Sum, and Table can iterate over a list:
list = {1, 2, 4, 8};Do[Print[{i, Log[2, i]}], {i, list}]Table[Log[2, i], {i, list}]Sum[k, {k, list}]Part can be used to get elements of lists:
list = {1, 2, 4, 8};list[[3]]You can get multiple parts by specifying a list of parts:
list[[{1, -1}]]Or by using Span:
list[[1 ;; -1 ;; 2]]Use Outer to apply a function to elements of multiple lists:
Outer[f, {1, 2}, {a, b, c}]Combining Lists (4)
Use Join to combine two lists end to end:
Join[{a, b, c}, {1, 2, 3}]Use Splice to insert elements of one list as individual elements of another list:
{a, b, Splice[{x, y}], d}A combination of Sequence and Apply can be used for the same effect:
{a, b, Sequence@@{x, y}, d}Unlike Sequence, Splice[list] is inert inside other functions:
f[a, b, Splice[{x, y}], d]Use Insert to place a whole list as a single element inside another list:
Insert[{1, 2, 3}, {a, b, c}, 2]Append behaves similarly:
Append[{1, 2, 3}, {a, b, c}]As does Prepend:
Prepend[{1, 2, 3}, {a, b, c}]Use Flatten to remove inner lists:
Flatten[{{1, 2}, {a, b, c}}]Lists as Finite Sets (2)
Complement, Union, and Intersection treat List as a set:
s1 = {a, b, c};
s2 = {c, d, e};Complement[s1, s2]Union[s1, s2]Intersection[s1, s2]Construct various combinatorial structures using Subsets, Tuples, and IntegerPartitions:
Subsets[{1, 2, 3}]Tuples[{{0, 1}, {a, b}}]IntegerPartitions[5]Lists as Control Structures (2)
Many commands use {var, vmin, vmax} as a specification of variable range:
Integrate[Sin[x], {x, 0, Pi / 2}]NDSolve[{x'[t] == x[t], x[0] == 1}, x, {t, 0, 1}]Table[var ^ 2, {var, -1, 3}]Many commands use {v1,v2,…} for a collection of variables:
Solve[{x + y + z == 0, x + y == 1, y + z == 2}, {x, y, z}]DSolve[{x'[t] == y[t], y'[t] == -x[t]}, {x, y}, t]Lists of Rules (2)
A list of rules is returned as a solution by many solving commands:
r = FindRoot[{Cos[x ^ 2 + y], (x - 2 y)}, {{x, 1}, {y, 2}}]You can use the values of the results with ReplaceAll:
{x, y} /. r{Cos[x ^ 2 + y], (x - 2 y)} /. rWhen multiple solutions are possible, the result is a list of rule lists:
s2 = Solve[{x ^ 2 + y ^ 2 == 1, x + y == 0}, {x, y}]When a list of rule lists is used in ReplaceAll, you get a list of results:
{x, y} /. s2x ^ 2 + y ^ 2 == 1 && x + y == 0 /. s2Even if there is only one solution, the extra List is used for consistent structure:
Solve[{x - y == 1, x + y == 0}, {x, y}]Lists of Data (3)
Lists are very good for holding data since the elements can be anything:
data = {{"George", "Washington", 1789, False}, {"John", "Adams", 1797, True}, {"Thomas", "Jefferson", 1801, True}};ssq = N[Sin[Range[10] ^ 2]]ListPlot[ssq]Data from a function sampled at points in two dimensions:
f[x_, y_] := Sin[2 Pi x y];
Short[data = Flatten[Table[{{x, y}, f[x, y]}, {x, 0., 1., .1}, {y, 0., 1., .1}], 1]]A piecewise polynomial that interpolates the data:
ifun = Interpolation[data]Plot the InterpolatingFunction:
Plot3D[ifun[x, y], {x, 0, 1}, {y, 0, 1}]ListPlot3D[Map[Flatten, data]]Properties & Relations (6)
Like all Wolfram Language expressions, lists are 1-indexed:
list = {a, b, c, d, e};Delete[list, 1]list[[3]]In most format types, including InputForm, lists are displayed as {…}:
InputForm[{a, b, c}]FullForm treats lists like any other expression, displaying them as List[…]:
FullForm[{a, b, c}]This makes it clear that lists have head List:
Head[{a, b, c}]Sequence is automatically spliced into lists:
{a, b, Sequence[x, y], d}This is a particular case of the general behavior of Sequence:
f[a, b, Sequence[x, y], d]Nothing is automatically removed from lists:
{a, b, Nothing, d}This behavior is specific to lists:
f[a, b, Nothing, d]A SparseArray represents a list:
list = {1, 0, 1, 0, 0, 1, 0, 0, 0, 1};slist = SparseArray[list]They are Equal:
slist == listThey can be equivalently used in many commands:
slist + 3 == list + 3Sin[N[slist]] == Sin[N[list]]They are not identical because the representation is different:
slist === listNormal[slist] gives the List representation:
Normal[slist]% === listParallelize[list] evaluates the elements of list in parallel:
Parallelize[{EchoEvaluation[0 + 1], EchoEvaluation[Pause[.1];Sqrt[4]], EchoEvaluation[6 / 2]}]History
Introduced in 1988 (1.0) | Updated in 2014 (10.0)
Text
Wolfram Research (1988), List, Wolfram Language function, https://reference.wolfram.com/language/ref/List.html (updated 2014).
CMS
Wolfram Language. 1988. "List." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/List.html.
APA
Wolfram Language. (1988). List. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/List.html
BibTeX
@misc{reference.wolfram_2026_list, author="Wolfram Research", title="{List}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/List.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_list, organization={Wolfram Research}, title={List}, year={2014}, url={https://reference.wolfram.com/language/ref/List.html}, note=[Accessed: 13-June-2026]}