Outer
✖
Outer
gives the generalized outer product of the listi, forming all possible combinations of the lowest‐level elements in each of them, and feeding them as arguments to f.
treats as separate elements only sublists at level ni in the corresponding listi.
Details

- Outer[Times,list1,list2] gives an outer product.
- The result of applying Outer to the tensors Ti1i2...ir and Uj1j2...js is the tensor Vi1i2...irj1j2...js with elements f[Ti1i2...ir,Uj1j2...js]. Applying Outer to two tensors of ranks r and s gives a tensor of rank r+s.
- The heads of all listi must be the same, but need not necessarily be List. »
- Outer[f] returns f[].
- The listi need not necessarily be cuboidal arrays.
- The specifications ni of levels must be positive integers, or Infinity.
- If only a single level specification is given, it is assumed to apply to all the listi. If there are several ni, but fewer than the number of listi, the lowest‐level elements in the remaining listi will be used.
- Outer can be used on SparseArray objects, returning a SparseArray object when possible. »
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases

https://wolfram.com/xid/0ldlxz2-ly1

Treat nested lists as rank-1 vectors of sublists:

https://wolfram.com/xid/0ldlxz2-wa


https://wolfram.com/xid/0ldlxz2-r48

Outer product of SparseArray objects:

https://wolfram.com/xid/0ldlxz2-il4xj

https://wolfram.com/xid/0ldlxz2-gawx3t

Generalizations & Extensions (1)Generalized and extended use cases
Applications (6)Sample problems that can be solved with this function

https://wolfram.com/xid/0ldlxz2-jzg


https://wolfram.com/xid/0ldlxz2-ekkchr


https://wolfram.com/xid/0ldlxz2-erd9i


https://wolfram.com/xid/0ldlxz2-xt6


https://wolfram.com/xid/0ldlxz2-yw1

Generate all possible binary trees with nodes from f and leaves from e to depth n:

https://wolfram.com/xid/0ldlxz2-ipc

https://wolfram.com/xid/0ldlxz2-pij

Apply a function on a tensor product grid:

https://wolfram.com/xid/0ldlxz2-jhp8zp

https://wolfram.com/xid/0ldlxz2-c6uxz4

Show a contour plot of the values and the grid:

https://wolfram.com/xid/0ldlxz2-dekt0g

https://wolfram.com/xid/0ldlxz2-jtpi58


https://wolfram.com/xid/0ldlxz2-bst7pp

Make a piecewise polynomial that interpolates the data:

https://wolfram.com/xid/0ldlxz2-caqvue


https://wolfram.com/xid/0ldlxz2-fc0uj

Properties & Relations (6)Properties of the function, and connections to other functions
The dimensions of the result are a concatenation of the dimensions of the inputs:

https://wolfram.com/xid/0ldlxz2-juj


https://wolfram.com/xid/0ldlxz2-xzg


https://wolfram.com/xid/0ldlxz2-ynt


https://wolfram.com/xid/0ldlxz2-o1t

Outer[f] returns f[]:

https://wolfram.com/xid/0ldlxz2-jt9pb7

Distribute forms the same combinations of all elements, but in a flat structure:

https://wolfram.com/xid/0ldlxz2-p03ygy


https://wolfram.com/xid/0ldlxz2-y35o87

KroneckerProduct is a flattened outer product of matrices:

https://wolfram.com/xid/0ldlxz2-f4y13j

https://wolfram.com/xid/0ldlxz2-dtxazh


https://wolfram.com/xid/0ldlxz2-djnzti


https://wolfram.com/xid/0ldlxz2-cz1hki

Part effectively uses an outer product when given lists of parts at multiple levels:

https://wolfram.com/xid/0ldlxz2-d20615


https://wolfram.com/xid/0ldlxz2-b4v3p4


https://wolfram.com/xid/0ldlxz2-fcm3gh

Table can also make a generalized outer product from lists:

https://wolfram.com/xid/0ldlxz2-jaocql

https://wolfram.com/xid/0ldlxz2-u4wq9


https://wolfram.com/xid/0ldlxz2-74m5l

Possible Issues (1)Common pitfalls and unexpected behavior
If backgrounds are inconsistent, a generalized outer product may not be sparse:

https://wolfram.com/xid/0ldlxz2-bxkerf

https://wolfram.com/xid/0ldlxz2-di58dx

You can convert it into a SparseArray by choosing a background:

https://wolfram.com/xid/0ldlxz2-f7j01

Wolfram Research (1988), Outer, Wolfram Language function, https://reference.wolfram.com/language/ref/Outer.html (updated 2020).
Text
Wolfram Research (1988), Outer, Wolfram Language function, https://reference.wolfram.com/language/ref/Outer.html (updated 2020).
Wolfram Research (1988), Outer, Wolfram Language function, https://reference.wolfram.com/language/ref/Outer.html (updated 2020).
CMS
Wolfram Language. 1988. "Outer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Outer.html.
Wolfram Language. 1988. "Outer." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/Outer.html.
APA
Wolfram Language. (1988). Outer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Outer.html
Wolfram Language. (1988). Outer. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Outer.html
BibTeX
@misc{reference.wolfram_2025_outer, author="Wolfram Research", title="{Outer}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/Outer.html}", note=[Accessed: 11-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_outer, organization={Wolfram Research}, title={Outer}, year={2020}, url={https://reference.wolfram.com/language/ref/Outer.html}, note=[Accessed: 11-May-2025
]}