A molding material which can produce cured products with long-lasting excellent transparency and heat resistance, a sealing material in which the molding material is used, and a sealed optical element are provided. The molding material comprises a polysilsesquioxane compound with a ladder structure having a repeating unit of the following formula (I) in the molecule as a major component.
wherein R1 represents a group shown by the formula AO—(CH2)r— (wherein A indicates a protective group for a hydroxyl group and r is an integer of 1 to 10), R2 represents a substituted or unsubstituted phenyl group, a substituted or unsubstituted (excluding substitution with OA in the above formula) alkyl group having 1 to 20 carbon atoms, or an alkenyl group having 2 to 20 carbon atoms, and l, m, and n individually represent 0 or an arbitrary integer, provided that l and n are not 0 at the same time.