NAMD is a molecular dynamics program designed for high-performance simulations of very large biological objects on central processing unit (CPU)-and graphics processing unit (GPU)-based architectures. NAMD offers scalable performance on petascale parallel supercomputers consisting of hundreds of thousands of cores, as well as on inexpensive commodity clusters commonly found in academic environments. It is written in C++ and leans on Charm++ parallel objects for optimal performance on low-latency architectures. NAMD is a versatile, multipurpose code that gathers state-of-the-art algorithms to carry out simulations in apt thermodynamic ensembles, using the widely popular CHARMM, AMBER, OPLS and GROMOS biomolecular force fields. Here, we review the main features of NAMD that allow both equilibrium and enhanced-sampling molecular dynamics simulations with numerical efficiency. We describe the underlying concepts utilized by NAMD and their implementation, most notably for handling long-range electrostatics, controlling the temperature, pressure and pH, applying external potentials on tailored grids, leveraging massively parallel resources in multiple-copy simulations, as well as hybrid QM/MM descriptions. We detail the variety of options offered by NAMD for enhanced-sampling simulations aimed at determining free-energy differences of either alchemical or geometrical transformations, and outline their applicability to specific problems. Last, we discuss the roadmap for the development of NAMD and our current efforts towards achieving optimal performance on GPUbased architectures, for pushing back the limitations that have prevented biologically realistic billion-atom objects to be fruitfully simulated, and for making large-scale simulations less expensive and easier to set up, run and analyze. NAMD is distributed free of charge with its source code at www.ks.uiuc.edu.