For spatial vectors, two basis vectors are not sufficient; a third one is needed. This third basis vector is denoted by k. This unit vector is perpendicular to both i and j.
However, in space, there are two possible vectors that satisfy the perpendicularity condition. The vector k is the one for which, when viewed from its endpoint, i must be rotated counterclockwise through j to obtain k. The line passing through the origin and having the same direction as k is called the z-axis. The vectors i, j, and k (in this order) form a right-handed system.