Techniques to detect and quantify DNA and RNA molecules in biological samples have had a central role in genomics research. Over the past decade, several techniques have been developed to improve detection performance and reduce the cost of genetic analysis. In particular, significant advances in label-free methods have been reported. Yet detection of DNA molecules at concentrations below the femtomolar level requires amplified detection schemes. Here we report a unique nanomechanical response of hybridized DNA and RNA molecules that serves as an intrinsic molecular label. Nanomechanical measurements on a microarray surface have sufficient background signal rejection to allow direct detection and counting of hybridized molecules. The digital response of the sensor provides a large dynamic range that is critical for gene expression profiling. We have measured differential expressions of microRNAs in tumour samples; such measurements have been shown to help discriminate between the tissue origins of metastatic tumours. Two hundred picograms of total RNA is found to be sufficient for this analysis. In addition, the limit of detection in pure samples is found to be one attomolar. These results suggest that nanomechanical read-out of microarrays promises attomolar-level sensitivity and large dynamic range for the analysis of gene expression, while eliminating biochemical manipulations, amplification and labelling.