The assessment of human epidermal growth factor receptor 2 (HER2) status in gastric cancer is crucial in selecting patients who may benefit from targeted therapy, yet heterogeneous expression could represent an important drawback for HER2 testing. We aimed to analyze (i) HER2 heterogeneity in primary gastric cancers, pre-neoplastic and metastatic lesions and (ii) HER2 prognostic role. We studied 292 surgically resected primary gastric carcinomas and constructed 21 tissue microarrays including tumor tissue cores, invasive front, paired lymph node metastasis, low- and high-grade dysplasia. Microarrays were immunohistochemically stained with HER2 antibody and digitally scanned. Novel digital analysis algorithms were developed to score HER2 expression. Fluorescence in situ hybridization was performed on equivocal cases. HER2-positive cases were 13% and heterogeneous HER2 expression was observed in 71% of positive samples. Analysis of HER2 status in tumor and tumor invasive front demonstrate concordance in 177 cases (88%). Comparison of HER2 expression in primary cancer and synchronous lymph node metastasis exhibited discordant status in 14% of cases. Dysplastic epithelium surrounding the tumor showed immunohistochemical score 2 or 3 in 19% of high-grade and in 9% of low-grade dysplastic samples. HER2 status was significantly associated with intestinal-type carcinomas (P=0.018) and prognosis since patients with primary HER2-positive tumor showed decreased overall survival (P=0.006). Intratumoral HER2 expression heterogeneity and variable lymph node metastases status strongly suggest evaluating more than one sample and, if available, metastatic foci for routinely HER2 testing.