PurposeThe results and side effects of sympathicotomy for primary palmar hyperhidrosis (PPH) can vary due to anatomical variations of the sympathetic ganglions. The aim of our study was to clarify anatomical variations of the sympathetic ganglions by near-infrared (NIR) thoracoscopy and determine their effects on sympathicotomy for PPH.MethodsThe cases of 695 consecutive patients with PPH treated with either R3 or R4 sympathicotomy either by normal thoracoscopy or by NIR fluorescent thoracoscopy between March 2015 and June 2021 were retrospectively reviewed and followed up.ResultsThe variation rate of third and fourth ganglions was 14.7% and 13.3% on the right side and 8.3% and 11.1% on the left side. Real T3 sympathicotomy (RTS3) was more effective than real T4 sympathicotomy (RTS4) in the short-term and long-term follow-up (p< 0.001 andp< 0.001, respectively). RTS3was more satisfactory than RTS4in the long-term follow-up (p= 0.03), but no significant difference was found in the short-term follow-up (p= 0.24). The incidence and severity of compensatory hyperhidrosis (CH) in the areas of the chest and back in the RTS4group were significantly lower than those in the RTS3group according to both the short-term results (12.92% vs. 26.19%,p< 0.001; 17.97% vs. 33.33%,p= 0.002, respectively) and the long-term results (19.66% vs. 28.57%,p= 0.017; 21.35% vs. 34.52%,p< 0.001, respectively).ConclusionsRTS3may be more effective than RTS4for PPH. However, RTS4appears to be associated with a lower incidence and severity of CH in the areas of the chest and back than RTS3.NIR intraoperative imaging of thoracic sympathetic ganglions may improve the quality of sympathicotomy surgeries.Supplementary InformationThe online version contains supplementary material available at 10.1007/s10286-023-00932-2.