Nicholas was born in the Alexander Palace in Saint Petersburg, Russian Empire, the eldest son of Emperor Alexander III and Empress Maria Feodorovna of Russia (formerly Princess Dagmar of Denmark). He had five younger siblings: Alexander (1869–1870), George (1871–1899), Xenia (1875–1960), Michael (1878–1918) and Olga (1882–1960). Nicholas often referred to his father nostalgically in letters after Alexander's death in 1894. He was also very close to his mother, as revealed in their published letters to each other.
His paternal grandparents were Emperor Alexander II and Empress Maria Alexandrovna of Russia (born Princess Marie of Hesse and by Rhine). His maternal grandparents were King Christian IX and Queen Louise of Denmark. Nicholas was of primarily German and Danish descent, his last ethnically Russian ancestor being Grand Duchess Anna Petrovna (1708-1728), daughter of Peter the Great.
Nicholas was related to several monarchs in Europe. His mother's siblings included Kings Frederik VIII of Denmark and George I of Greece, as well as the United Kingdom's Queen Alexandra (consort of King Edward VII). Nicholas, his wife Alexandra, and Kaiser Wilhelm II of Germany were all first cousins of King George V of the United Kingdom. Nicholas was also a first cousin of both King Haakon VII and Queen Maud of Norway, as well as King Constantine I of Greece. Nicholas and Wilhelm II were in turn second cousins-once-removed, as each descended from King Frederick William III of Prussia, as well as third cousins, as they were both great-great-grandsons of Tsar Paul I of Russia. In addition to being second cousins through descent from Louis II, Grand Duke of Hesse and by Rhine and his wife Wilhelmine of Baden, Nicholas and Alexandra were also third cousins-once-removed, as they were both descendants of King Frederick William II of Prussia.
Tsar Nicholas II was the first cousin-once-removed of Grand Duke Nicholas Nikolaevich. To distinguish between them the Grand Duke was often known within the Imperial family as "Nikolasha" and "Nicholas the Tall", while the Tsar was "Nicholas the Short".
In his childhood, Nicholas, his parents and siblings made annual visits to the Danish royal palaces of Fredensborg and Bernstorff to visit his grandparents, the king and queen. The visits also served as family reunions, as his mother's siblings would also come from the United Kingdom, Germany and Greece with their respective families. It was there in 1883, that he had a flirtation with one of his English first cousins, Princess Victoria. In 1873, Nicholas also accompanied his parents and younger brother, two-year-old George, on a two-month, semi-official visit to England. In London, Nicholas and his family stayed at Marlborough House, as guests of his "Uncle Bertie" and "Aunt Alix," the Prince and Princess of Wales, where he was spoiled by his uncle.