In Illinois* credit against a sentence of imprisonment for each day spent in pre-sentencing detention is mandatory by statute. To use md2000’s terminology, it’s a 1:1 credit. Because the credit is a statutory requirement, a defendant whose credit was improperly computed may raise the issue at any time, even years later, and (if he or she is correct) must receive an adjustment.
The issue of home monitoring and the like is very interesting and somewhat complicated in Illinois, having been decided by the state supreme court interpreting the credit statute. A defendant released on bond with a bond condition of home monitoring or periodic physical reporting is not in custody and not due credit at sentencing. A defendant not on bond who the sheriff decides to release from jail on condition of reporting in person or home monitoring is in custody and due credit. The difference is that bond can’t be revoked without a court hearing but the sheriff can revoke a wholly discretionary conditional release at any time for no reason.
As to sentencing guidelines (“the extent that the judge has complete leeway in deciding the length of the sentence”), Illinois criminal law sets sentencing ranges for offenses, with six classes of felonies, three classes of misdemeanors, and petty offenses. For example: armed robbery is a Class X felony, and Class X felonies get 6 to 30 years’ imprisonment. Burglary is a Class 2 felony, and Class 2 felonies get 3 to 7 years’ imprisonment. First degree murder is in a class by itself (Class M) and gets 20 to 60 years’ imprisonment.
There are extended terms for each of the classes (for example, an extended Class 2 is 7 to 14 years’ imprisonment, and an extended first degree murder is life imprisonment or death) based on a statutory list of factors, including prior felony convictions of the same or greater class in the last 10 years, that the crime was exceptionally brutal or heinous, and that the victim was under 12, over 60, or handicapped. However, except when the extending fact is prior convictions, the jury (in a jury trial) must find the extending fact for the judge to apply an extended term sentence.
These ranges of prison terms don’t mean that probation, or similar dispositions like conditional discharge and supervision, are unavailable, they just mean that if a judge doesn’t sentence a particular defendant to probation or the like, the prison sentence must be in that range. Certain offenses are by statute ineligible for probation and the like, including first degree murder, attempted first degree murder, and all Class X felonies.
To make a long story short, an Illinois judge has a sentencing range that comes with the offense but then gives a particular sentence within that range of pretty much whatever he or she feels is appropriate.
*The only state I feel comfortable answering for, as I’m an attorney only in Illinois. Of course, I’m not your attorney, “you” being anyone reading this post. 