Responding to a campaign led by a 15-year-old schoolgirl, a spokesman said ministers agreed that boys and girls “should be treated equally” when it came to the uniforms they wore.
The development comes after teenager Jess Insall successfully passed a motion in favour of the move at the Scottish Liberal Democrat conference last month.
The schoolgirl argued that allowing children of either gender to choose whether they wanted to wear trousers or skirts was a “sensible” move that should ultimately be rolled out UK-wide.
Scotland’s 32 local councils currently bear responsibility for setting school uniform policy, but Ms Insall said ministers should act to create a coherent national policy on the issue.
“It isn’t saying that everyone has to wear the same uniform – it’s saying that whatever the uniform is, there can’t be any difference between genders,” she said.
“Instead of saying boys have to wear trousers and girls have to wear skirts, schools can say pupils can choose between skirts or trousers.
“It’s not about dictating the way anyone dresses. ‘Gender-neutral’ can be quite an alienating term, but all it really means is not treating people differently because of their gender.”
The schoolgirl’s impressive speech at the Lib Dem conference in November led to delegates passing a motion calling for the Scottish Government to take action on the issue.
The move was also backed by the party’s UK deputy leader Jo Swinson, who campaigned for girls to be allowed to wear trousers when she was a student at Douglas Academy in Milngavie.
A Scottish Government spokesman said: “Ministers are clear that girls and boys should be treated equally and schools should ensure suitable school clothing is worn.”
Earlier this week, F1 driver Lewis Hamilton apologised for making “inappropriate” comments in an Instagram video in which he appeared to mock his nephew’s princess dress. In the video, apparently filmed on Christmas Day, the Formula 1 driver said “boys don’t wear princess dresses”, sparking a wave of criticism on social media.
Ms Insall argued that a nationwide uniform policy would lead to happier pupils who would in turn be more productive – as well as sending a strong international signal on gender equality.
“On the practical side, we’ve had really cold weather lately and for girls wearing skirts can be incredibly uncomfortable. I’ve been wearing two pairs of tights every day,” she said. “It also encourages physical activity if girls have more practical options.”
She added that it would promote gender equality from an early age and would make it easier for transgender and non-binary pupils to embrace their identities and “take things at their own pace”.
Ms Insall, from Strathblane in Stirlingshire, has already lobbied her own school’s headteacher to change its uniform policy. Her actions have proved controversial among some of her peers.
“I have always been quite outspoken about it. I have experienced people who weren’t too pleased about it.”