Diagnosis typically involves a thorough clinical examination by a dermatologist, who may use a dermatoscope to examine the pigmentation pattern. If subungual melanoma is suspected, a biopsy may be performed to analyze the tissue under a microscope. This helps in confirming the presence of cancerous cells. In some cases, imaging techniques like X-rays or MRI may be employed to assess the extent of the disease.