A method for determining the spatial location of a target nucleic acid in a biological specimen, comprising: (a) providing a solid support comprising a population of nucleic acids randomly located across a population of features on the solid support, wherein the nucleic acids are attached to the solid support, wherein the nucleic acids comprise a spatial tag sequence and a primer binding sequence, and wherein the spatial tag sequence differs from spatial tag sequences of other nucleic acids in the population; (b) performing a sequencing reaction to determine the spatial tag sequences of the nucleic acids randomly located across the population of features on the solid support, thereby determining the position of the spatial tag sequences on the solid support; (c) adding a capture sequence on the nucleic acids randomly located across the population of features on the solid support; (d) contacting a biological specimen with the solid support that comprises the nucleic acids; (e) hybridizing a target nucleic acid from the biological specimen to the capture sequence on a nucleic acid that is proximal to the target nucleic acid; (f) producing a nucleic acid that comprises a sequence complementary to the target nucleic acid hybridized to the capture sequence, or a portion thereof, and a sequence of the spatial tag sequence, or a complement thereof, and a sequence of the primer binding sequence, or a complement thereof; (g) removing the nucleic acid of step (f) and attaching the nucleic acid to a second solid support; and (h) determining the sequence of the nucleic acid attached to the second solid support, thereby determining the spatial location of the target nucleic acid in the biological specimen. (a) providing a solid support comprising a population of nucleic acids randomly located across a population of features on the solid support, wherein the nucleic acids are attached to the solid support, wherein the nucleic acids comprise a spatial tag sequence and a primer binding sequence, and wherein the spatial tag sequence differs from spatial tag sequences of other nucleic acids in the population; (b) performing a sequencing reaction to determine the spatial tag sequences of the nucleic acids randomly located across the population of features on the solid support, thereby determining the position of the spatial tag sequences on the solid support; (c) adding a capture sequence on the nucleic acids randomly located across the population of features on the solid support; (d) contacting a biological specimen with the solid support that comprises the nucleic acids; (e) hybridizing a target nucleic acid from the biological specimen to the capture sequence on a nucleic acid that is proximal to the target nucleic acid; (f) producing a nucleic acid that comprises a sequence complementary to the target nucleic acid hybridized to the capture sequence, or a portion thereof, and a sequence of the spatial tag sequence, or a complement thereof, and a sequence of the primer binding sequence, or a complement thereof; (g) removing the nucleic acid of step (f) and attaching the nucleic acid to a second solid support; and (h) determining the sequence of the nucleic acid attached to the second solid support, thereby determining the spatial location of the target nucleic acid in the biological specimen.