For a 6DoF robot with all revolute joints the Jacobian is given by:
$$
\mathbf{J} = 
\begin{bmatrix}
\hat{z\_0} \times (\vec{o\_6}-\vec{o\_0}) & \ldots & \hat{z\_5} \times (\vec{o\_6}-\vec{o\_5})\\
\hat{z\_0} & \ldots & \hat{z\_5}
\end{bmatrix}
$$
where $z\_i$ is the unit z axis of joint $i+1$(using DH params), $o\_i$ is the origin of the coordinate frame connected to joint $i+1$, and $o\_6$ is the origin of the end effector. The jacobian matrix is the relationship between the Cartesian velocity vector and the joint velocity vector:
$$
\dot{\mathbf{X}}=
\begin{bmatrix}
\dot{x}\\
\dot{y}\\
\dot{z}\\
\dot{r\_x}\\
\dot{r\_y}\\
\dot{r\_z}
\end{bmatrix}
=
\mathbf{J}
\begin{bmatrix}
\dot{\theta\_1}\\
\dot{\theta\_2}\\
\dot{\theta\_3}\\
\dot{\theta\_4}\\
\dot{\theta\_5}\\
\dot{\theta\_6}\\
\end{bmatrix}
=
\mathbf{J}\dot{\mathbf{\Theta}}
$$

Here is a singularity position of a Staubli TX90XL 6DoF robot:

![robot with joint 4 and joint 6 aligned pointed down](https://i.imgur.com/Ikjas0J.png)

$$
\mathbf{J} = 
\begin{bmatrix}
 -50 & -425 & -750 & 0 & -100 & 0\\
 612.92 & 0 & 0 & 0 & 0 & 0\\
 0 & -562.92 & 0 & 0 & 0 & 0\\
 0 & 0 & 0 & 0 & 0 & 0\\
 0 & 1 & 1 & 0 & 1 & 0\\
 1 & 0 & 0 & -1 & 0 & -1
\end{bmatrix}
$$

You can easily see that the 4th row corresponding to $\dot{r\_x}$ is all zeros, which is exactly the lost degree of freedom in this position.

However, other cases are not so straightforward.

![robot with joint 4 and joint 6 aligned pointed at an angle](https://i.imgur.com/cAUoVq3.png)
$$
\mathbf{J} = 
\begin{bmatrix}
 -50 & -324.52 & -649.52 & 0 & -86.603 & 0\\
 987.92 & 0 & 0 & 0 & 0 & 0\\
 0 & -937.92 & -375 & 0 & -50 & 0\\
 0 & 0 & 0 & 0.5 & 0 & 0.5\\
 0 & 1 & 1 & 0 & 1 & 0\\
 1 & 0 & 0 & -0.866 & 0 & -0.866
\end{bmatrix}
$$

Here you can clearly see that joint 4 and joint 6 are aligned because the 4th and 6th columns are the same. But it's not clear which Cartesian degree of freedom is lost (it should be a rotation about the end effector's x axis in red).

Even less straightforward are singularities at workspace limits.

![robot at workspace limit with no aligned joint axes](https://i.imgur.com/ykxmMUH.png)

$$
\mathbf{J} = 
\begin{bmatrix}
 -50 & 650 & 325 & 0 & 0 & 0\\
 1275.8 & 0 & 0 & 50 & 0 & 0\\
 0 & -1225.8 & -662.92 & 0 & -100 & 0\\
 0 & 0 & 0 & 0.86603 & 0 & 1\\
 0 & 1 & 1 & 0 & 1 & 0\\
 1 & 0 & 0 & 0.5 & 0 & 0
\end{bmatrix}
$$

In this case, the robot is able to rotate $\dot{-r\_y}$ but not $\dot{+r\_y}$. There are no rows full of zeros, or equal columns, or any clear linearly dependent columns/rows. 

Is there a way to determine which degrees of freedom are lost by looking at the jacobian?