Crigler-Najjar syndrome is a severe metabolic disease of the liver due to a reduced activity of the UDP Glucuronosyltransferase 1A1 (UGT1A1) enzyme. In an effort to translate to the clinic an adeno-associated virus vector mediated liver gene transfer approach to treat Crigler-Najjar syndrome, we developed and optimized a vector expressing the UGT1A1 transgene. For this purpose, we designed and tested in vitro and in vivo multiple codon-optimized UGT1A1 transgene cDNAs. We also optimized noncoding sequences in the transgene expression cassette. Our results indicate that transgene codon-optimization is a strategy that can improve efficacy of gene transfer but needs to be carefully tested in vitro and in vivo. Additionally, while inclusion of introns can enhance gene expression, optimization of these introns, and in particular removal of cryptic ATGs and splice sites, is an important maneuver to enhance safety and efficacy of gene transfer. Finally, using a translationally optimized adeno-associated virus vector expressing the UGT1A1 transgene, we demonstrated rescue of the phenotype of Crigler-Najjar syndrome in two animal models of the disease, Gunn rats and Ugt1a1-/- mice. We also showed long-term (>1 year) correction of the disease in Gunn rats. These results support further translation of the approach to humans.