The measures will be introduced during the Edinburgh International Festival and Fringe to prevent vehicles being driven into pedestrians.
Police Scotland’s Edinburgh police division made the announcement on its Facebook page and says the barriers will be introduced over three weeks in August.
A police spokesman said: “Following recent attacks in London and Manchester, Police Scotland have been reviewing security arrangements for this year’s events with our partners, including the City of Edinburgh Council, the Royal Edinburgh Military Tattoo and Edinburgh International Festival/Fringe.
“Following this review, Police Scotland, in collaboration with the City of Edinburgh Council, submitted a request for the deployment of the national barrier asset (NBA) at certain city-centre locations for the duration of the festival and fringe.
“The NBA is a temporary deployed system including high security gates, portals and barriers which are designed to prevent hostile vehicle attacks on key or busy crowded place locations.”
The Edinburgh division said there was “no specific intelligence” to suggest this year’s events are at risk from a terrorist attack.
It added the threat to the UK from terrorism remains at “severe”, which means an attack is “highly likely”.
Security measures including high-security gates, portals and barriers will be put in place after a review of visitor numbers in the city.
The security barriers have been used at other major events in the UK including Wimbledon and the European Cup Final in Cardiff.
Their use in Edinburgh has been approved and will be funded by the UK Government.
Police Scotland added: “The NBA forms part of Police Scotland’s holistic security plan for this year’s event.
“It will help to keep people safe whilst attending events at Edinburgh Castle and the High Street in the event of vehicle as a weapon attacks, such as those seen at Westminster Bridge and Borough Market in London.”