University student Michal Szewczuk created an image of the Duke of Sussex with a pistol to his head against a bloodied background.
The picture, which also featured a swastika, was shared on a far-right social media site in August last year. The post included the phrase "See Ya Later Race Traitor".
The 19-year-old, of Wyther Park in Bramley, Leeds, also wrote an "extremely violent and aggressively misogynistic" blog which attempted to justify the rape of women and children in the pursuit of an Aryan race.
Szewczuk appeared at the Old Bailey, alongside 18-year-old Oskar Dunn-Koczorowski, from west London.
Referring to the image of Prince Harry, Judge Rebecca Poulet QC said: "The posts I have seen and read are abhorrent as well as criminal by reason of their clear intention to encourage terrorist acts."
The pair were arrested in December after posting images or links to Gab, a social media platform which attracts mainly far-right users, last summer, the content of which was influenced by extreme far-right groups.
One of those, Atomwaffen Division, is described as "a youth-driven, national socialist group at the extreme end of the revolutionary right-wing spectrum" and has been linked to five murders in the US since 2017, the court heard.
Prosecutor Naomi Parsons said the posts, made across three accounts by the two youths "convey a message of the threat of and/or use of serious violence against others, in order to advance a political, ideological and racial cause (neo-Nazism) and in this way encourage terrorism".
She told the court that targets included Jewish people, non-white people and anyone "perceived to be complicit in the perpetuation of multi-culturalism".
Szewczuk, who was arrested at his halls of residence during his first year studying computer science at Portsmouth University, had a "difficult and disordered upbringing" and had suffered with depression "for a considerable period", his lawyer, Adam Morgan, said.
The court heard that he moved to the UK from Poland at the age of 10, living first in Northern Ireland, and then moving to Leeds.
Dunn-Koczorowski was just 17 at the time of the offences and was living at home.
His lawyer, David Kitson, admitted that Dunn-Koczorowski's mindset had not changed since the offences were committed, quoting from a medical report which said the teenager had a "lack of remorse" for his views and a "deeply entrenched ideology".
Szewczuk was sentenced to four years and three months in a young offenders institute after pleading guilty to two counts of encouraging terrorism and five counts of possession of terrorist material, including the White Resistance Manual and the Al Qaeda Trading Manual.
The judge said: "Individuals were urged to go out and commit appalling acts of violence on others for no reason that can ever be understood by any right thinking individuals."
Dunn-Koczoroswik was given an 18 month detention and training order. Sentencing him, the judge said: "You still hold deeply entrenched views in support of this extreme right-wing ideology."
Detective Chief Superintendent Martin Snowden, the head of Counter Terrorism Police North East said both Szweczuk and Dunn-Koczorowski saw themselves as "superior to the majority of society" and felt it was their duty to express their beliefs.
Mr Snowden said: “The considerable amount of material they have posted on social media channels not only reflects their extremist beliefs but was intended to encourage others to carry out despicable acts.
“Both men have developed and evolved their interest in the extreme right wing ideology over time through research and connecting with like-minded individuals.
“We will tackle all forms of toxic extremism which has the potential to threaten public safety and security. We work tirelessly with our partners to confront them and bring those involved to justice.
“With the enduring terrorist threat, it is now more important than ever that everyone plays their part in tackling terrorism. The cooperation between public and police is a powerful defence.