Extra late-night trains will run from Edinburgh to help people travelling home from festival events next month.
ScotRail said that tens of thousands of extra seats are being added at the times when they are needed most in August.
Late-night services will operate every night, from August 4 to 27, from Edinburgh Waverley to Glasgow Queen Street via Falkirk High.
On Fridays, from August 4 to 25, late-night trains will run from Edinburgh to Glasgow Queen Street Low Level via Bathgate and Airdrie, to Dundee, Glenrothes with Thornton, and North Berwick.
Late-night trains from Edinburgh to Dundee, and to Glasgow Queen Street Low Level via Bathgate and Airdrie will operate on Saturdays between August 5 and 26.
There will also be a late-night service from North Berwick to Edinburgh from Friday August 4 to Sunday August 13 to support return travel from Fringe by the Sea.
And on Sundays between August 6 and August 27 an extra late-night service will run from Edinburgh to North Berwick.
David Simpson, ScotRail service delivery director, said: “ScotRail is excited to play its part in making the Edinburgh festivals a success, and we look forward to welcoming all visitors to the capital city aboard our trains.
“To support the event, we’ve made significant enhancements to our services.
“We’ll be providing more trains, including late-night services, to accommodate the increased demand during this vibrant period and we’ve added tens of thousands of extra seats at the times when they are needed the most.
“Our service will be busy throughout the festivals, so customers should plan their journeys in advance.
“To make your travel experience as smooth as possible, I’d encourage everyone to purchase their train tickets before boarding.
“The mTicket system, available on the ScotRail app, offers a convenient way to secure your tickets and download them straight to your mobile phone, avoiding any unnecessary queues on the day.”
The Edinburgh Festival Fringe, Edinburgh International Festival, Edinburgh International Book Festival and Edinburgh International Film Festival all take place next month.
Shona McCarthy, Edinburgh Festival Fringe Society chief executive, said: “ScotRail’s service is a key transport offering for the thousands of audiences coming to Edinburgh this August to experience the summer festivals.
“The addition of extra carriages and later night trains across the central belt will allow audiences greater flexibility in watching a range of work at the Fringe.
“Helping audiences navigate their Fringe experience is one of our key areas of work, and our thanks to the ScotRail team for their support through these extra services.”