It aims to examine imbalances in women's representation on boards and gather views on how any inequality can be addressed, if required.
Currently this power sits with the UK Government, the Scottish Government said.
The consultation 'Women On Board: Quality Through Diversity' asks how mandatory quotas could be implemented for public bodies, and if potential legislation should be extended to company boards.
Equalities Secretary Shona Robison MSP said: "It's clear that even in this day and age we still have gender inequality on our public boards.
"That is why we are taking our commitment to women's representation further than any other Scottish Government has done before.
"Our ambition is for Scotland's public and corporate institutions to properly reflect the communities they serve, which will contribute to moving us towards the more equal Scotland we wish to see.
"This consultation is looking for views on how mandatory quotas that ensure a minimum of 40% of women's representation could be introduced."
She added: "Every woman should be able to fulfil their potential in the labour market and in their wider life.
"Scottish women make up 52% of our population. They clearly have a voice to be heard and we will do all that we can to make sure this happens by driving forward this consultation on legislation."
The Scottish Government said that the results of the consultation will help make the case to the UK Government that Scotland should have responsibility for these issues.
Next month, the Scottish Government will hold the first ever all-women Cabinet event in Edinburgh.