inserts elem at position n in list. If n is negative, the position is counted from the end.


inserts elem at position {i,j,} in expr.


inserts elem at several positions.


represents an operator form of Insert that can be applied to an expression.


  • list can have any head, not necessarily List.
  • Insert works on SparseArray objects by effectively inserting into the corresponding ordinary lists.
  • If expr is an Association object, Insert[expr,key->value,pos] inserts an element in the association.
  • If the specified position is of the form "key" or Key[k], then Insert inserts a new element before the one corresponding to this key, or overwrites the value if this key is already present.
  • If the key of the element to be inserted is already present, then the old element with the same key is deleted.
  • Insert[elem,pos][expr] is equivalent to Insert[expr,elem,pos].


open allclose all

Basic Examples  (10)

Insert x to be at position 3:

Insert x to be at position 2 from the end:

Insert x at several positions:

Insert into a 2D array:

Insert an element before a

Insert several elements:

Inserting entries with repeating keys in an Association overrides earlier values:

Insert in an Association using position:

Insert after the last element:

Insert at deeper levels:

Generalizations & Extensions  (2)

Insert into an expression with any head:

Insert at any position in any expression:

Applications  (1)

Insert into a held expression:

Wolfram Research (1988), Insert, Wolfram Language function, (updated 2014).


Wolfram Research (1988), Insert, Wolfram Language function, (updated 2014).


Wolfram Language. 1988. "Insert." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014.


Wolfram Language. (1988). Insert. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2024_insert, author="Wolfram Research", title="{Insert}", year="2014", howpublished="\url{}", note=[Accessed: 17-June-2024 ]}


@online{reference.wolfram_2024_insert, organization={Wolfram Research}, title={Insert}, year={2014}, url={}, note=[Accessed: 17-June-2024 ]}