"Sandcastles in the Sand" is a song written by Craig Thomas and Carter Bays for the CBS television series How I Met Your Mother. The song was performed by Canadian actress Cobie Smulders in the role of Robin Scherbatsky, who has a secret past as a teenage Canadian pop star under the stage name Robin Sparkles. A follow-up to "Let's Go to the Mall" (2006), "Sandcastles in the Sand" was inspired by several 1980s pop ballads. The song was made available for streaming on April 15, 2008, before it appeared in an episode of the same name that aired on April 21. It was released as a single on April 23, and appeared on the soundtrack album How I Met Your Music (2012).