Gradnik was born in the village of Medana in the Gorizia Hills region, in what was then the Austro-Hungarian Empire and is today in the Municipality of Brda of Slovenia. His father was a Slovene from Trieste who came from a poor working-class background, but created considerable wealth by winemaking. His mother was an ethnic Friulian from the County of Gorizia and Gradisca. His younger brother Jožef later served as mayor of the village.
Gradnik attended the multilingual State Gymnasium in Gorizia. He lived in a student home run by the Catholic Church. Among his friends from this period were Avgust Žigon, who later became a renowned literary scholar, the Slovene writer Ivan Pregelj and the Friulian prelate Luigi Fogar, who later served as bishop of Trieste. After finishing high school, he went to study law in Vienna. After graduation in 1907, he served as a district judge in the Istrian city of Pula, in Gorizia and in other smaller towns throughout the Austrian Littoral. During this period, he was active in Slovene and Croat cultural and political associations. Between 1913 and 1915, he frequented the intellectual circles of young Slovene national-liberals in Gorizia. Among his friends from the period were Andrej Gabršček, the leader of the National Progressive Party in Gorizia and Gradisca, the young historian and jurist Bogumil Vošnjak and the lawyers Dinko Puc and Drago Marušič, who all later became prominent liberal politicians in the Kingdom of Yugoslavia.
In 1924, he married Mira Potokar, with whom he had a son, Sergij.
In 1920, after the Italian annexation of the Julian March, he emigrated to the Kingdom of Yugoslavia, where he continued his career as a judge. In the late 1920s, he worked as an expert consultant at the Ministry of Justice in Belgrade. He was later appointed member of the High Court for the Security of the State, in which political trials were conducted. From 1936 and 1941 he served as a member of the "Bank of the Seven" (Stol sedmorice), the court of cassation which had jurisdiction on all former Austro-Hungarian parts of Yugoslavia. The court was located in Zagreb and during his stay in the Croatian capital, Gradnik enjoyed the company of Croat intellectuals like the writer Vladimir Nazor, historian Antun Barac, and poet Ivan Goran Kovačić.
After the Axis invasion of Yugoslavia in April 1941, he was expelled by the new Fascist authorities of the Independent State of Croatia. He moved back to Ljubljana. Between 1942 and 1943, he was internated in the Gonars concentration camp by the Italian Fascist occupation authorities. The concentration camp experience would strongly influence his later poetry. After the end of World War II, he returned to Ljubljana, where he spent the rest of his life as a pensioner. After September 1947, when the Slovenian Littoral was annexed to Yugoslavia, he regularly visited his native village, spending most of the summer season writing poetry.
Gradnik was a polyglot: besides Slovene, he was fluent in Italian, Friulian, German, Serbo-Croatian, English, and French. He also spoke Russian, Hungarian, and Spanish, and knew Latin and Ancient Greek. He studied several oriental languages, such as Sanskrit, Persian, Bengali and Mandarin.
He died in Ljubljana.
Gradnik was a prolific author. During his lifetime, between 1916 and 1944, he published nine collections of poems and left a large number of unpublished works. Together with Izidor Cankar and Ivan Pregelj, Gradnik belonged to the second generation of modernist authors in Slovenian literature (the first was composed by Ivan Cankar, Oton Župančič, Dragotin Kette, and others). Gradnik was most influenced by the work of the poet Josip Murn Aleksandrov, and was probably among the first to acknowledge Murn's poetic genius. Like Murn, Gradnik incorporated impressionist visions of the countryside and peasant life into his poetry. Gradnik's style and vocabulary were simple, but his motifs and contents complex.
Gradnik's early poetry was strongly inspired by both the older generations of Slovenian poets (the modernists, but also Simon Gregorčič and France Prešeren) and the European decadent movement. One of the specific traits of Gradnik's early period was his intense focus on the relationship between Eros and Thanatos: that is, between erotic passion and the motive of death. He later moved away from decadentism, rediscovering his Roman Catholic faith and turning to more mystical themes, maintaining a simple and plain language. He also wrote patriotic songs, in which he conveyed intimate sentiments of pain, hope and frustration for the tragedies in the contemporary Slovenian history.
Gradnik was also very influenced by the visual arts, especially painting and sculpture. He wrote a book on the Slovene impressionist painter Rihard Jakopič and maintained a close friendship with the painter Ivan Grohar, the illustrators Riko Debenjak and Miha Maleš, and the sculptor Jakob Savinšek. Several painters strongly influenced his work, especially Eugène Carrière, Božidar Jakac, and the Brueghels.
Gradnik was also an important translator. Among other works, he translated the first two parts of Dante's Divine Comedy into Slovene. He also translated works of other important authors, including Francesco Petrarca, Giacomo Leopardi, Rabindranath Tagore, Giosuè Carducci, Romain Rolland, Omar Khayyam, Jovan Jovanović Zmaj, Vuk Karadžić, Ivan Mažuranić, Petar Petrović Njegoš, Ugo Foscolo, Anton Chekhov, Juan Ramón Jiménez, John Erskine, Federico García Lorca, Sándor Petőfi, Endre Ady. He also wrote children's literature.
Today, Gradnik is considered the most important Slovenian poet in the interwar period, next to Oton Župančič, and one of the most important Slovene poets of the 20th century. In his lifetime, however, he was mostly disregarded by critics. With his traditional style and conservative worldview, he remained outside the contemporary literary mainstream. However, he influenced the work of some highly talented non-conventional authors such as Lili Novy and France Balantič.
After the establishment of the Communist regime in Yugoslavia after 1945, his position deteriorated. Gradnik was an anti-Fascist, he sympathised with the Liberation Front of the Slovenian People, and even wrote several poems about the Yugoslav People's Liberation War in Slovenia. Nevertheless, his deep Christian religious sentiment and his magical realistic style were seen as reactionary by the Communists. His membership in the High Tribunal for the Security of the State, which condemned several Communist activists, was a further reason for his fall into disgrace during Josip Broz Tito's regime. He did not suffer any persecution, but he was pushed away from public life. Between 1945 and 1967, he published mostly translations and none of his new poetry was published. There was no public commemoration upon his death and he was not included in the canon taught in schools. In Yugoslavia, no street or institution was named after him until 1990. Nevertheless, many of his poems gained much popularity in his home region and a local school in the Italian commune of San Floriano del Collio was named after him in the late 1970s.
Gradnik was rediscovered in the late 1980s, when he was elevated to a truly national poet for the first time. He became a major source of influence for the younger generations of postmodern authors, such as Brane Senegačnik, Nevin Birsa, Aleš Šteger, and others.
Since mid-1996, an annual festival has been held in August in his home village of Medana, called Days of Poetry and Wine (Dnevi poezije in vina), to which young international poets are invited.