The legislatures, courts, probation departments, parole boards and, in some jurisdictions, sentencing commissions all play a role in the sentencing process. In the first instance, criminal sentences, or at least the maximum permissible sentence for each offense, are prescribed by legislatures. State sentencing statutes vary considerably and sometimes the same state has different types of sentencing statutes for different crimes. Sentence is imposed by the judge after a sentencing hearing at which the prosecutor and defense attorney argue for the sentence each thinks is appropriate. The defendant is usually given an opportunity to address the court prior to sentence. In some jurisdictions, the victim or the victim's representatives may address the court as well. The defense lawyer is likely to emphasize the defendant's remorse, family responsibilities, good job prospects and amenability to out-patient treatment (if necessary) in the community; the prosecution is likely to emphasize the defendant's prior criminal record, injuries to the victim and the victim's family, and the need to deter other would-be offenders.
The judge is advised by the probation department, which independently investigates the defendant's background, prior criminal record, circumstances of the offense and other factors. The judge does not have to make formal factual findings and need not write an opinion explaining or justifying the sentence. As long as the sentence is within the statutory range, it cannot be appealed.