Minnesota is the 20th most expensive state for monthly energy costs, according to new ranking out this week by WalletHub.

Minnesotans paid $299 per month on average during 2016 for a basket of energy, including electricity, gasoline and natural gas and home heating oil.

Connecticut was the most expensive state at $404 a month, while Washington was the least at $218, according to WalletHub, a personal finance website.

WalletHub factors in both energy cost and energy consumption. So, perhaps it's no surprise that northern states ranked the highest for costs for natural gas, a key heating fuel.

Minnesota had the 10th highest monthly natural gas costs at $57 per month. The state came in 38th for electricity costs at $108 per month and 10th in motor fuel costs at $128.

Wisconsin overall ranked 31st with $285 in monthly energy costs. The state's electricity and natural gas costs were in line with Minnesota's, but its motor fuel costs were $114 per month -- $14 less than Minnesota's.