die Haft
imprisonment
The state of being in prison; a prison sentence.
Der Angeklagte wurde zu drei Jahren Haft verurteilt.
The defendant was sentenced to three years' imprisonment.

custody / imprisonment
Loading your saved state.
imprisonment
The state of being in prison; a prison sentence.
Der Angeklagte wurde zu drei Jahren Haft verurteilt.
The defendant was sentenced to three years' imprisonment.

'Haft' (custody/imprisonment) belongs to the word family of 'haften' in the sense of 'festhalten' (to hold onto/detain). The basic idea is that a person is being held.
Der Verdächtige wurde in Haft genommen.
The suspect was taken into custody.
The word 'Haft' (custody/imprisonment) is a formal term from legal and official language. It is mainly used in official contexts such as news reports, court reports, or police statements.
Die Staatsanwaltschaft forderte eine lange Haftstrafe.
The public prosecutor demanded a long prison sentence.
When referring to a prison sentence, typical phrases are: 'zu Haft verurteilt werden' (to be sentenced to imprisonment), 'eine Haftstrafe verbüßen' (to serve a prison sentence), or 'aus der Haft entlassen werden' (to be released from prison).
Er wurde zu fünf Jahren Haft ohne Bewährung verurteilt.
He was sentenced to five years' imprisonment without parole.
The phrase 'in Haft' (in custody) is a fixed combination and describes the state of being detained. Typical verbs are 'in Haft sein/sitzen' (to be in custody), 'sich in Haft befinden' (to be in custody), or 'jemanden in Haft nehmen' (to take someone into custody).
Der Mann sitzt seit zwei Wochen in Untersuchungshaft.
The man has been in pre-trial detention for two weeks.
freedom
'die Freiheit' and 'die Haft' are opposites in this context. Freedom means that someone is not imprisoned and can move around freely. 'Haft' means that someone is being held by the police or judicial authorities, or is in prison. The words can be confused especially in sentences about courts or the police, because both describe a person's legal status. For example, you say 'in Haft sein' (to be in custody / prison), but 'in Freiheit sein' (to be free) or 'die Freiheit verlieren' (to lose one's freedom).

Nach dem Urteil muss Herr Yilmaz mehrere Monate in Haft.
After the verdict, Mr. Yilmaz has to spend several months in prison.
Nach vielen Jahren im Gefängnis genießt er seine Freiheit.
After many years in prison, he is enjoying his freedom.