We demonstrated that 5-vinyldeoxyuridine ((V)U) and 5-carboxyvinyldeoxyuridine ((CV)U) can be used to photoligate a longer oligonucleotide (ODN) from smaller ODNs on a template. By performing irradiation at 366 nm, these artificial nucleotides make photoligated ODNs with high efficiency without any side reactions. Moreover, by performing irradiation at 312 nm, these photoligated ODNs were reversed to the original ODN. (V)U needs to be irradiated 366 nm for 6 h, but (CV)U needs to be irradiated at 366 nm for 15 min. Finally, we made a self-assembled structure with an ODN containing (CV)U and observed the photoligated ODN by photoirradiation.