Interest in optical materials for biomedical imaging and sensing applications has grown significantly in recent decades. Among a variety of material choices, single-walled carbon nanotubes (SWCNTs) are emerging materials for molecular imaging, sensing, and optoelectronic applications due to their nonphotobleaching photoluminescence in the tissue-transparent near-infrared spectral window. However, pristine SWCNTs need surface functionalization to render them soluble in biofriendly media and facilitate their interaction with target analytes. Understanding the functionalization of SWCNTs and the structures of their resulting molecular assemblies plays a pivotal role in yielding efficient optical probes and sensors. Studies have shown that the size, composition, configuration, and concentration of functionalizing compounds on the nanotube surface can affect the nanotube dispersions and optical characteristics. Herein, we review recent progress in the design, synthesis, and applications of SWCNT-based optical nanosensors. An overview of nanotube structure, functionalization, suspension of SWCNTs in solutions with various dispersants, and their molecular assemblies presented from molecular dynamics simulation studies is provided. We further discuss how these assemblies along with solvent dielectric affect nanotube dispersion efficiencies, their role in a nanotube's optical response to a change in its local environment, and how a nanotube's optical properties are utilized for sensor development.