Quantifying cognitive workload, i.e., the level of mental effort put forth by an individual in response to a cognitive task, is relevant for healthcare, training and gaming applications. However, there is currently no technology available that can readily and reliably quantify the cognitive workload of an individual in a real-world environment at a seamless way and affordable price. In this work, we overcome these limitations and demonstrate the feasibility of a magnetocardiography (MCG) sensor to reliably classify high vs. low cognitive workload while being non-contact, fully passive and low-cost, with the potential to have a wearable form factor. The operating principle relies on measuring the naturally emanated magnetic fields from the heart and subsequently analyzing the heart rate variability (HRV) matrix in three time-domain parameters: standard deviation of RR intervals (SDRR); root mean square of successive differences between heartbeats (RMSSD); and mean values of adjacent R-peaks in the cardiac signals (MeanRR). A total of 13 participants were recruited, two of whom were excluded due to low signal quality. The results show that SDRR and RMSSD achieve a 100% success rate in classifying high vs. low cognitive workload, while MeanRR achieves a 91% success rate. Tests for the same individual yield an intra-subject classification accuracy of 100% for all three HRV parameters. Future studies should leverage machine learning and advanced digital signal processing to achieve automated classification of cognitive workload and reliable operation in a natural environment.