Products
  • Wolfram|One

    The definitive Wolfram Language and notebook experience

  • Mathematica

    The original technical computing environment

  • System Modeler

    Multidomain modeling and simulation of complex systems

  • Compute ServicesUse with Mathematica and Wolfram|One
  • AI AccessUse with Mathematica and Wolfram|One
  • Finance Platform
  • Wolfram|Alpha Notebook Edition
  • Application Server
  • Enterprise Private Cloud
  • Wolfram Engine
  • Wolfram Player
  • Wolfram Cloud App
  • Wolfram Player App

More mobile apps

Wolfram|Alpha

  • Wolfram|Alpha Website
  • Wolfram|Alpha APIs

AI Products

  • Wolfram AI Ecosystem
  • Wolfram Foundation Tool
  • Wolfram Cloud MCP
  • Wolfram Local MCP
  • Agent One API
  • CAG Component APIs

Core Technologies of Wolfram Products

  • Wolfram Language
  • Computable Data
  • Wolfram Notebooks
  • Linguistic Understanding

Additional Deployment Options

  • Wolfram Cloud
  • Wolfram Web Engine
  • wolframscript
  • WSTPServer
  • Group & Organizational Licensing
  • All Products
Consulting & Solutions

We deliver solutions for the AI era—combining symbolic computation, data-driven insights and deep technical expertise

Wolfram Consulting

Data Science, Finance & Business

  • Artificial Intelligence
  • Data Science
  • Healthcare
  • Real Estate

Engineering

  • Civil Engineering
  • Automotive Engineering
  • Sustainable Energy

Science & Technology

  • AgTech
  • Biosciences
  • Environmental Science
  • Food Science
  • Quantum Computation
  • Social and Behavioral Sciences

More Wolfram Solutions

Technology for Education

  • Research Universities
  • Colleges & Teaching Universities
  • High Schools
  • Resources for Students

Education Initiatives

  • Next-Gen EdTech
  • Computer-Based Math

More Solutions for Education

  • Contact Us
Learning & Support

Get Started

  • Wolfram Language Introduction
  • Fast Intro for Programmers
  • Fast Intro for Math Students
  • Wolfram Language Documentation

More Learning

  • Highlighted Core Areas
  • Demonstrations
  • YouTube
  • Daily Study Groups
  • Wolfram Schools and Programs
  • Books

Grow Your Skills

  • Wolfram U

    Courses in computing, science, life and more

  • Community

    Learn, solve problems and share ideas.

  • Blog

    News, views and insights from Wolfram

  • Resources for

    Software Developers

Tech Support

  • Contact Us
  • Support FAQs
  • Support FAQs
  • Contact Us
Company
  • About Wolfram
  • Career Center
  • All Sites & Resources
  • Connect & Follow
  • Contact Us

Work with Us

  • Student Ambassador Initiative
  • Wolfram for Startups
  • Student Opportunities
  • Jobs Using Wolfram Language

Educational Programs for Adults

  • Summer School
  • Winter School

Educational Programs for Youth

  • Middle School Camp
  • High School Research Program
  • Computational Adventures

Read

  • Stephen Wolfram's Writings
  • Wolfram Blog
  • Wolfram Tech | Books
  • Wolfram Media
  • Complex Systems

Educational Resources

  • Wolfram MathWorld
  • Wolfram in STEM
  • Wolfram Challenges
  • Wolfram Problem Generator

Wolfram Initiatives

  • Wolfram Science
  • Wolfram Foundation
  • History of Mathematics Project

Events

  • Stephen Wolfram Livestreams
  • Online & In-Person Events
  • Contact Us
  • Connect & Follow
For AIs
  • Your Account
  • User Portal
  • Wolfram Cloud
  • Products
    • Wolfram|One
    • Mathematica
    • System Modeler
    • Compute ServicesUse with Mathematica and Wolfram|One
    • AI AccessUse with Mathematica and Wolfram|One
    • Finance Platform
    • Wolfram|Alpha Notebook Edition
    • Application Server
    • Enterprise Private Cloud
    • Wolfram Engine
    • Wolfram Player
    • Wolfram Cloud App
    • Wolfram Player App

    More mobile apps

    • Wolfram|Alpha
      • Wolfram|Alpha Website
      • Wolfram|Alpha APIs
    • AI Products
      • Wolfram AI Ecosystem
      • Wolfram Foundation Tool
      • Wolfram Cloud MCP
      • Wolfram Local MCP
      • Agent One API
      • CAG Component APIs
    • Core Technologies
      • Wolfram Language
      • Computable Data
      • Wolfram Notebooks
      • Linguistic Understanding
    • Additional Deployment Options
      • Wolfram Cloud
      • Wolfram Web Engine
      • wolframscript
      • WSTPServer
    • Group & Organizational Licensing
    • All Products
  • Consulting & Solutions
    • Wolfram Consulting

    Data Science, Finance & Business

    • Artificial Intelligence
    • Data Science
    • Healthcare
    • Real Estate

    Engineering

    • Civil Engineering
    • Automotive Engineering
    • Sustainable Energy

    Science & Technology

    • AgTech
    • Biosciences
    • Environmental Science
    • Food Science
    • Quantum Computation
    • Social and Behavioral Sciences

    More Wolfram Solutions

    Technology for Education

    • Research Universities
    • Colleges & Teaching Universities
    • High Schools
    • Resources for Students

    Education Initiatives

    • Next-Gen EdTech
    • Computer-Based Math

    More Solutions for Education

    • Contact Us
  • Learning & Support

    Get Started

    • Wolfram Language Introduction
    • Fast Intro for Programmers
    • Fast Intro for Math Students
    • Wolfram Language Documentation

    Grow Your Skills

    • Wolfram U

      Courses in computing, science, life and more

    • Community

      Learn, solve problems and share ideas.

    • Blog

      News, views and insights from Wolfram

    • Resources for

      Software Developers
    • Tech Support
      • Contact Us
      • Support FAQs
    • More Learning
      • Highlighted Core Areas
      • Demonstrations
      • YouTube
      • Daily Study Groups
      • Wolfram Schools and Programs
      • Books
    • Support FAQs
    • Contact Us
  • Company
    • About Wolfram
    • Career Center
    • All Sites & Resources
    • Connect & Follow
    • Contact Us

    Work with Us

    • Student Ambassador Initiative
    • Wolfram for Startups
    • Student Opportunities
    • Jobs Using Wolfram Language

    Educational Programs for Adults

    • Summer School
    • Winter School

    Educational Programs for Youth

    • Middle School Camp
    • High School Research Program
    • Computational Adventures

    Read

    • Stephen Wolfram's Writings
    • Wolfram Blog
    • Wolfram Tech | Books
    • Wolfram Media
    • Complex Systems
    • Educational Resources
      • Wolfram MathWorld
      • Wolfram in STEM
      • Wolfram Challenges
      • Wolfram Problem Generator
    • Wolfram Initiatives
      • Wolfram Science
      • Wolfram Foundation
      • History of Mathematics Project
    • Events
      • Stephen Wolfram Livestreams
      • Online & In-Person Events
    • Contact Us
    • Connect & Follow
  • For AIs
  • Wolfram Cloud
  • Your Account
  • User Portal
Wolfram Language & System Documentation Center
ArrayQ
  • See Also
    • ArrayDepth
    • MatrixQ
    • VectorQ
    • Dimensions
    • PadLeft
    • ArrayFlatten
    • Array
  • Related Guides
    • Tensors
    • Testing Expressions
    • GPU Computing
    • Elements of Lists
    • GPU Computing with NVIDIA
    • GPU Computing with Apple
  • Tech Notes
    • Putting Constraints on Patterns
    • Nested Lists
    • Tensors
    • See Also
      • ArrayDepth
      • MatrixQ
      • VectorQ
      • Dimensions
      • PadLeft
      • ArrayFlatten
      • Array
    • Related Guides
      • Tensors
      • Testing Expressions
      • GPU Computing
      • Elements of Lists
      • GPU Computing with NVIDIA
      • GPU Computing with Apple
    • Tech Notes
      • Putting Constraints on Patterns
      • Nested Lists
      • Tensors

ArrayQ[expr]

gives True if expr is a full array, and gives False otherwise.

ArrayQ[expr,patt]

requires expr to be a full array with a depth that matches the pattern patt.

ArrayQ[expr,patt,test]

requires also that test yield True when applied to each of the array elements in expr.

Details
Details and Options Details and Options
Examples  
Basic Examples  
Scope  
Applications  
Properties & Relations  
See Also
Tech Notes
Related Guides
History
Cite this Page
BUILT-IN SYMBOL
  • See Also
    • ArrayDepth
    • MatrixQ
    • VectorQ
    • Dimensions
    • PadLeft
    • ArrayFlatten
    • Array
  • Related Guides
    • Tensors
    • Testing Expressions
    • GPU Computing
    • Elements of Lists
    • GPU Computing with NVIDIA
    • GPU Computing with Apple
  • Tech Notes
    • Putting Constraints on Patterns
    • Nested Lists
    • Tensors
    • See Also
      • ArrayDepth
      • MatrixQ
      • VectorQ
      • Dimensions
      • PadLeft
      • ArrayFlatten
      • Array
    • Related Guides
      • Tensors
      • Testing Expressions
      • GPU Computing
      • Elements of Lists
      • GPU Computing with NVIDIA
      • GPU Computing with Apple
    • Tech Notes
      • Putting Constraints on Patterns
      • Nested Lists
      • Tensors

ArrayQ

ArrayQ[expr]

gives True if expr is a full array, and gives False otherwise.

ArrayQ[expr,patt]

requires expr to be a full array with a depth that matches the pattern patt.

ArrayQ[expr,patt,test]

requires also that test yield True when applied to each of the array elements in expr.

Details

  • In a full array, all parts at a particular level must be lists of the same length, though different parts may use different list representations.
  • A full array is also known as a rectangular array.
  • Possible representations of an array include: »
  • {…} or List[…], {{…},{…},…}, etc.an ordinary list, possibly nested
    SparseArray[…]a sparse array
    TabularColumn[…], PermutationMatrix[…], QuantityArray[…], SymmetrizedArray[…], etc.a structured array
    {a1,a2,…}, where ArrayQ[ai] is Truea list of ordinary, sparse, and/or structured arrays »
  • ArrayQ[expr,1|2] tests whether expr is either a vector or a matrix. »
  • The empty list {} is a zero-length vector. »
  • Common values of test in ArrayQ[expr,patt,test] for use with numeric arrays include:
  • NumberQtest if expr is an array of explicit numbers
    NumericQtest if expr is an array of numeric expressions
    Positivetest if expr is an array of positive numbers
    RealValuedNumberQtest if expr is an array of numbers with head Integer, Rational or Real
    RealValuedNumericQtest if expr is an array of numeric expressions with real values
  • Structural tests commonly used include:
  • IntegerQtest if expr is an array of integers
    PolynomialQ[#,x]&test if expr is an array of polynomials in x
    QuantityQtest if expr is an array of quantities
    StringQtest if expr is an array of strings

Examples

open all close all

Basic Examples  (2)

A vector of numbers is a full array:

Wolfram Language code: ArrayQ[{1, 2, 3, 4}]

A vector in which one element is itself a list is not a full array:

Wolfram Language code: ArrayQ[{1, 2, {3}, 4}]

A ragged collection of nested lists is not a full array:

Wolfram Language code: ArrayQ[{{1, 2}, {3}}]
Wolfram Language code: ArrayQ[{{1, 2}, {3, 4}}]

Scope  (11)

Many different heads can represent an array:

Wolfram Language code: ArrayQ[SparseArray[{{1, 3} -> a, {5, 1} -> b}]]
Wolfram Language code: ArrayQ[TabularColumn[{1, 2, 3}, "Integer8"]]
Wolfram Language code: ArrayQ[SymmetrizedArray[{1, 2, 3} -> 1, {3, 3, 3}, Antisymmetric[All]]]

Test for a vector:

Wolfram Language code: ArrayQ[{1, 2, 3, 4}, 1]
Wolfram Language code: ArrayQ[{{1, 2}, {3, 4}}, 1]

Test for a matrix:

Wolfram Language code: ArrayQ[{1, 2, 3, 4}, 2]
Wolfram Language code: ArrayQ[{{1, 2}, {3, 4}}, 2]

Test for a vector or a matrix:

Wolfram Language code: ArrayQ[{1, 2, 3, 4}, 1 | 2]
Wolfram Language code: ArrayQ[{{1, 2}, {3, 4}}, 1 | 2]

An array can have elements in different representations of a list:

Wolfram Language code: mat = {{1, 2, 3}, SparseArray[Automatic, {3}, 0, {1, {{0, 1}, {{3}}}, {a}}], TabularColumn[{4, 5, 6}, "Integer64"]}; ArrayQ[mat]

This array is a matrix:

Wolfram Language code: ArrayQ[mat, 2]

For deeper arrays, more combinations are possible:

Wolfram Language code: arr = {mat, SymmetrizedArray[{{1, 2} -> b, {3, 3} -> d}, {3, 3}, Symmetric[{1, 2}]]}

This array has depth 3:

Wolfram Language code: ArrayQ[arr, 3]

View the contents of the array:

Wolfram Language code: arr//MatrixForm

Test for a numeric vector:

Wolfram Language code: ArrayQ[{1, 2, 3, x}, 1, NumericQ]

Test for an array of any depth with numeric entries:

Wolfram Language code: ArrayQ[{{{E, 1}, {Pi, 2}}, {{Sin[1], Cos[2]}, {Sinh[1], Cosh[1]}}}, _, NumericQ]

Test instead for entries that are explicit numbers:

Wolfram Language code: ArrayQ[{{{E, 1}, {Pi, 2}}, {{Sin[1], Cos[2]}, {Sinh[1], Cosh[1]}}}, _, NumberQ]

Test for a vector of real-valued numeric quantities:

Wolfram Language code: ArrayQ[{1, Pi, Sin[1], Sqrt[2]}, 1, RealValuedNumericQ]

Faster test for explicit real-valued numbers:

Wolfram Language code: ArrayQ[{1, Pi, Sin[1], 3 / 4}, 1, RealValuedNumberQ]

Test for an array of odd depth containing numbers that are integers when rounded to two decimal places:

Wolfram Language code: ArrayQ[{1, 1.005, 1.997}, _ ? OddQ, Abs[# - Round[#]] < 0.005&]

Test for a matrix of strings:

Wolfram Language code: ArrayQ[{{"a", "b"}, {"c", "d"}}, 2, StringQ]
Wolfram Language code: ArrayQ[{{"a", "b"}, {c, d}}, 2, StringQ]

Test for a vector or matrix of polynomials in x:

Wolfram Language code: ArrayQ[{1, x, 1 + x, x ^ 2 + 2x + 1}, 1 | 2, PolynomialQ[#, x]&]
Wolfram Language code: ArrayQ[{1, x, Sin[x], Exp[x]}, 1 | 2, PolynomialQ[#, x]&]

Applications  (1)

Define a function that only evaluates with arrays:

Wolfram Language code: iptp[a_ ? ArrayQ, x_] := Module[{n, at = a}, n = ArrayDepth[a]; Do[ at = Transpose[at, RotateRight[Range[ArrayDepth[at]]]]; at = Map[InterpolatingPolynomial[#, Subscript[x, i]]&, at, {n - i}], {i, n}]; at]

This constructs the tensor product interpolating polynomial assuming integer coordinates:

Wolfram Language code: data = {{{1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}}, {{13, 14, 15, 16}, {17, 18, 19, 20}, {21, 22, 23, 24}}}; poly = iptp[data, x]

The polynomial interpolates the data:

Wolfram Language code: pos = Position[data, _ ? NumberQ]; poly /. Map[Thread[{Subscript[x, 1], Subscript[x, 2], Subscript[x, 3]} -> #]&, pos]
Wolfram Language code: % === Extract[data, pos]

Properties & Relations  (5)

An empty list is considered a zero-length vector:

Wolfram Language code: ArrayQ[{}, 1]

VectorQ[expr] is equivalent to ArrayQ[expr,1]:

Wolfram Language code: v = {1, 2., E, Pi + I};
Wolfram Language code: {VectorQ[v], ArrayQ[v, 1]}

VectorQ[expr,test] is equivalent to ArrayQ[expr,1,test]:

Wolfram Language code: {VectorQ[v, NumericQ], ArrayQ[v, 1, NumericQ]}
Wolfram Language code: {VectorQ[v, Im[#] == 0&], ArrayQ[v, 1, Im[#] == 0&]}

MatrixQ[expr] is equivalent to ArrayQ[expr,2]:

Wolfram Language code: m = RandomReal[1, {2, 2}]
Wolfram Language code: {ArrayQ[m, 2], MatrixQ[m]}

MatrixQ[expr] is equivalent to ArrayQ[expr,2]:

Wolfram Language code: {ArrayQ[m, 2, MachineNumberQ], MatrixQ[m, MachineNumberQ]}
Wolfram Language code: {ArrayQ[m, 2, IntegerQ], MatrixQ[m, IntegerQ]}

For a depth-3 array arr, VectorQ[arr,MatrixQ] and MatrixQ[arr,VectorQ] give True:

Wolfram Language code: arr = Array[a, {2, 3, 4}]; {ArrayQ[arr, 3], VectorQ[arr, MatrixQ], MatrixQ[arr, VectorQ]}

The converse of this statement is False:

Wolfram Language code: narr = {Array[a, {3, 4}], Array[a, {3, 5}]}; {ArrayQ[narr, 4], VectorQ[narr, MatrixQ], MatrixQ[narr, VectorQ]}

ArrayQ effectively uses AllowedHeads"ListLike":

Wolfram Language code: mat = {SparseArray[{1, 2}], QuantityArray[{1, 2}, "Meters"]}; expr = f[f[1, 2], f[3, 4]];
Wolfram Language code: {ArrayQ[mat], ArrayQ[expr]}
Wolfram Language code: {ArrayDepth[mat, AllowedHeads -> "ListLike"], ArrayDepth[expr, AllowedHeads -> "ListLike"]}
Wolfram Language code: {Dimensions[mat, AllowedHeads -> "ListLike"], Dimensions[expr, AllowedHeads -> "ListLike"]}

See Also

ArrayDepth  MatrixQ  VectorQ  Dimensions  PadLeft  ArrayFlatten  Array

Function Repository: TableQ

Tech Notes

    ▪
  • Putting Constraints on Patterns
  • ▪
  • Nested Lists
  • ▪
  • Tensors

Related Guides

    ▪
  • Tensors
  • ▪
  • Testing Expressions
  • ▪
  • GPU Computing
  • ▪
  • Elements of Lists
  • ▪
  • GPU Computing with NVIDIA
  • ▪
  • GPU Computing with Apple

History

Introduced in 2003 (5.0) | Updated in 2012 (9.0)

Wolfram Research (2003), ArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayQ.html (updated 2012).

Text

Wolfram Research (2003), ArrayQ, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayQ.html (updated 2012).

CMS

Wolfram Language. 2003. "ArrayQ." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ArrayQ.html.

APA

Wolfram Language. (2003). ArrayQ. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayQ.html

BibTeX

@misc{reference.wolfram_2026_arrayq, author="Wolfram Research", title="{ArrayQ}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ArrayQ.html}", note=[Accessed: 01-September-2026]}

BibLaTeX

@online{reference.wolfram_2026_arrayq, organization={Wolfram Research}, title={ArrayQ}, year={2012}, url={https://reference.wolfram.com/language/ref/ArrayQ.html}, note=[Accessed: 01-September-2026]}

Top
Introduction for Programmers
Introductory Book
Wolfram Function Repository | Wolfram Data Repository | Wolfram Data Drop | Wolfram Language Products
Top
  • Products
  • Wolfram|One
  • Mathematica
  • AI Access
  • Compute Services
  • System Modeler

  • Wolfram|Alpha Notebook Edition
  • Wolfram|Alpha Pro
  • Mobile Apps

  • Wolfram Engine
  • Wolfram Player

  • Volume & Site Licensing
  • Server Deployment Options
  • Consulting
  • Wolfram Consulting
  • Repositories
  • Data Repository
  • Function Repository
  • Community Paclet Repository
  • Neural Net Repository
  • Prompt Repository

  • Wolfram Language Example Repository
  • Notebook Archive
  • Wolfram GitHub
  • Learning
  • Wolfram U
  • Wolfram Language Documentation
  • Webinars & Training
  • Educational Programs

  • Wolfram Language Introduction
  • Fast Introduction for Programmers
  • Fast Introduction for Math Students
  • Books

  • Wolfram Community
  • Wolfram Blog
  • Public Resources
  • Wolfram|Alpha
  • Wolfram Problem Generator
  • Wolfram Challenges

  • Computer-Based Math
  • Computational Thinking
  • Computational Adventures

  • Demonstrations Project
  • Wolfram Data Drop
  • MathWorld
  • Wolfram Science
  • Wolfram Media Publishing
  • Customer Resources
  • Store
  • Product Downloads
  • User Portal
  • Your Account
  • Organization Access

  • Support FAQ
  • Contact Support
  • Company
  • About Wolfram
  • Careers
  • Contact
  • Events
Wolfram Community Wolfram Blog
Legal & Privacy Policy
WolframAlpha.com | WolframCloud.com
© 2026 Wolfram
© 2026 Wolfram | Legal & Privacy Policy |
English