Nerve regeneration in adult mammalian spinal cord is poor because of the lack of intrinsic regeneration of neurons and extrinsic factors – the glial scar is triggered by injury and inhibits or promotes regeneration. Recent technological advances in spatial transcriptomics (ST) provide a unique opportunity to decipher most genes systematically throughout scar formation, which remains poorly understood. Here, we first constructed the tissue-wide gene expression patterns of mouse spinal cords over the course of scar formation using ST after spinal cord injury from 32 samples. Locally, we profiled gene expression gradients from the leading edge to the core of the scar areas to further understand the scar microenvironment, such as neurotransmitter disorders, activation of the pro-inflammatory response, neurotoxic saturated lipids, angiogenesis, obstructed axon extension, and extracellular structure re-organization. In addition, we described 21 cell transcriptional states during scar formation and delineated the origins, functional diversity, and possible trajectories of subpopulations of fibroblasts, glia, and immune cells. Specifically, we found some regulators in special cell types, such as Thbs1 and Col1a2 in macrophages, CD36 and Postn in fibroblasts, Plxnb2 and Nxpe3 in microglia, Clu in astrocytes, and CD74 in oligodendrocytes. Furthermore, salvianolic acid B, a blood–brain barrier permeation and CD36 inhibitor, was administered after surgery and found to remedy fibrosis. Subsequently, we described the extent of the scar boundary and profiled the bidirectional ligand-receptor interactions at the neighboring cluster boundary, contributing to maintain scar architecture during gliosis and fibrosis, and found that GPR37L1_PSAP, and GPR37_PSAP were the most significant gene-pairs among microglia, fibroblasts, and astrocytes. Last, we quantified the fraction of scar-resident cells and proposed four possible phases of scar formation: macrophage infiltration, proliferation and differentiation of scar-resident cells, scar emergence, and scar stationary. Together, these profiles delineated the spatial heterogeneity of the scar, confirmed the previous concepts about scar architecture, provided some new clues for scar formation, and served as a valuable resource for the treatment of central nervous system injury.