Al-Khazini was an emancipated slave in Marv, which was then one of the most important cities of Khorasan. He got his name from his master (Abu‘l Husayn ‘Alī ibn Muhammad al-Khāzin al-Marwazī) who was the treasurer of Marv. The term khāzin was simply the title of the royal treasurer since the early Islamic period. His master made provisions so that al-Khazini could obtain a first-class education. Some believe that al-Khazini was a pupil of Omar Khayyam. While this is not known, he wrote about Khayyam, in particular, he gave a description of the water-balance invented by him (and improved upon by Al-Isfizari). And according to some sources, he collaborated with him on the reformation of the Persian calendar in 1079.