Travelling from Sapporo to Hakodate on the Shinkansen is quite a long journey. The journey is usually from 3.5 – 4 hours long and I would recommend to definitely stay at least the night if you do visit. A day trip may be rushed and you don’t have enough time to see more of Hokkaido’s 3rd most largest city. It was however a pleasant journey as I sat on a window seat, I jumped on the unreserved carriage and it wasn’t packed at all. However during the trip when passing Chitose and Tomakomai station I noticed it became a full carriage as there were many tourists on the way to Hakodate too.