In computer science, a number, usually a reasonably small positive integer, sometimes zero, used to indicate the position within an array that an instruction is intended to access.

An example, in BASIC:


DIM A(10) ' Dimension an array A to contain 10 elements
FOR I = 1 TO 10
   A(I) = I ' Set each element of A equal to its location index
NEXT I

Using A(I) to access, say, the 2nd element of array A when I = 2, is called indexing the array.