Extra late night trains are to run from Edinburgh during the August festivals.
ScotRail said more carriages will also be added to trains connecting the capital to Glasgow, Fife and North Berwick during the festivals.
Late night trains will run daily between Edinburgh Waverley and Glasgow Queen Street, leaving at 00:01 and 00:30, with an increase in the number of carriages at weekends.
ScotRail has urged people to plan journeys in advance.
Extra carriages will also be used between Edinburgh and Fife on Friday evenings and all day Saturday and Sunday, with an extra service running after midnight between North Berwick and Edinburgh, getting people to and from the Fringe by the Sea.
Perry Ramsey, ScotRail Alliance operations director, said: "Edinburgh's August festivals are one of the highlights of the year, attracting talent and tourists from all over the world. It's a great chance to showcase the very best of Scotland.
"The ScotRail Alliance will once again do everything it can to help the events run smoothly. We will put on more services, late-night trains and extra carriages compared to our regular timetable.
"But despite these extra services and carriages we are putting on, trains will be very, very busy during the festivals. Thousands of people will be travelling to and from Edinburgh to enjoy the great attractions the festivals have to offer."
Shona McCarthy, chief executive of the Edinburgh Festival Fringe Society, said: "We are delighted that the ScotRail Alliance is providing extra rail services to and from Edinburgh during August.
"These additional services will make it easier for people to enjoy the Fringe and Edinburgh's other major festivals, and also comfortably get back to their homes right across Scotland's central belt."