Carranza graduated in medicine from the University of San Carlos in Guatemala. After returning to Costa Rica he practiced both privately and in the State-run Hospital San Juan de Dios. He was inspector general of vaccinations and proto-medicines. He served in Nicaragua as a military doctor during the 1856 Campaign against William Walker, but had to return almost immediately due to a Costa Rican Army retreat and a cholera epidemic. He also worked as a journalist, publishing several newsletters and newspapers such as El Álbum and La Estrella del Irazú. He was also active in other diverse economic and commercial ventures, and among other businesses, he owned coffee plantations, a book store, and a boutique. From 1855 to 1859 he was awarded the administration of the National Liquor Factory and thus became the only official State supplier of alcohol.
Public office
He was deputy for several periods under the Mora Porras administration. He became the Costa Rican ambassador to El Salvador in 1857. He represented San José in the Constituent Assembly of 1869, although he stepped down soon after his election. Politically he was considered a liberal, sometimes even anti-clerical, and was exiled more than once because of his political beliefs. The coup d'état of 27 April 1870 turned him into the head of state with the official title of Temporary Head of the Republic. During his administration the district of Limón was created, laws outlining personal and religious freedoms were dictated, and a law of guarantees was passed which for the first time in the country's history banned the death penalty. The so-called Secretarías de Estado were also regulated and new elections for a Constituent Assembly were held. The principal figure in his administration and author of his policies towards external relations and freedom of creed was the Guatemalan lawyer Lorenzo Montúfar y Rivera, noted advocated of anti-clericalism. Other notable Secretaries of State during his time in office were Joaquín Lizano Gutiérrez, Rafael Gallegos Sáenz, and Buenaventura Carazo Alvarado. Due to differences with Tomás Guardia Gutiérrez on August 8, 1870, he presented his resignation to the Constituent Assembly, which was accepted the next day on August 9. General Guardia succeeded him. He was later a member of the Grand National Counsel and Plenipotentiary Minister of Costa Rica in El Salvador, where he signed the Carranza-Arbizú Accord.