Hitler was found guilty in his 1924 trial for treason, but the judge was a Nationalist sympathiser and gave him only five years in prison of which Hitler only served 9 months
The NSDAP was banned, although this was lifted in February 1925.
Hitler used his time in prison to change his strategy from gaining power through violent protest to winning power through democratic elections.
He also used the time to write his memoirs, ‘Mein Kampf
Hitler gained national publicity during his trial
The Nazis won 32 seats in their first election in May 1924 (under a different name as they were technically banned) to begin their new strategy