Figures from the Association of Scottish Visitor Attractions (ASVA) have shown that, in total, 1.81 million people visited the Edinburgh museum - a 15.5% rise on the previous year.
Edinburgh Castle welcomed 1.77 million people, up 13.4% on 2015.
Visits across Scotland rose for the third year running in 2016.
Almost 30 million visits were made to 249 of the ASVA members' sites in Scotland last year - a rise of 6% on 2015 figures.
The National Museum of Scotland opened 10 new galleries in July 2016.
Director Dr Gordon Rintoul said: "I am delighted that the latest ASVA visitor figures have confirmed the National Museum of Scotland's place as the most popular visitor attraction in Scotland.
"In addition, we recorded the highest-ever visitor numbers across all our sites with nearly 2.7 million visits."
1 National Museum of Scotland (free), Edinburgh  - 1,810,948 visitors
2 Edinburgh Castle (paid) - 1,778,548 visitors
3 Scottish National Gallery (free), Edinburgh - 1,544,069 visitors
4 Kelvingrove Art Gallery and Museum (free), Glasgow - 1,259,318
5 Riverside Museum (free), Glasgow - 1,259,042
6 St Giles' Cathedral (free), Edinburgh - 1,171,793
7 Royal Botanic Garden Edinburgh (free) - 857,268
8 Gretna Green (free) - 794,543
9 National War Museum (free), Edinburgh - 678,982
10 Gallery of Modern Art (free), Glasgow - 646,567
Four other sites welcomed more than one million visitors each, with Kelvingrove Art Gallery and Museum and the Riverside Museum, both in Glasgow, attracting more than 1.25 million people each.
The Scottish National Gallery and St Giles' Cathedral, both in Edinburgh, drew 1.54 million and 1.17 million visitors respectively.
Eleven of the top 20 attractions were located in the capital, compared with nine in 2015.
Sites outside the top 20 were also successful in attracting more visitors.
The Black Watch Castle & Museum in Perth and Kinross saw a 1,248% rise in numbers, largely on the back of "Weeping Window", a sculpture featuring thousands of handmade ceramic poppies commemorating those who died in World War One.
Last year, 195,301 people visited the museum, up from 14,483 visitors in 2015.
In the Highlands, interest generated by the Outlander TV series helped boost visitor numbers at the Culloden Battlefield Visitor Centre, which rose 21% from 115,923 in 2015 to 139,691 last year.
Culture Secretary Fiona Hyslop said: "It is fantastic that Scottish visitor attractions recorded another successful year in 2016, with almost 30 million visits to some of Scotland's most popular and iconic tourist sites.
"I commend the sterling work of ASVA in creating quality visitor experiences and building Scotland's reputation as a top tourist destination for visitors from around the world."
ASVA chairman Douglas Walker said the figures demonstrated that the visitor attractions sector in Scotland was in "robust health".

The monument, at White Brae, Ligoneil, commemorates three fusiliers from Scotland who were killed in March 1971.
John MacVicar, from the local Royal British Legion branch, said paint has been poured over the memorial and on wreaths that had been left by mourners.
He said vandals also tried to break the granite in the attack on Tuesday night.
The memorial was erected three years ago at the site where the bodies of teenage brothers John and Joseph McCaig, and their 23-year-old colleague Dougald McCaughey, were found more than three decades before.
Mr MacVicar, who helped raise funds to build the monument, is the secretary of Oldpark/Cavehill Royal British Legion branch.
He said he believed it was a "sectarian hate attack".
"This is now the fifth time the memorial has been attacked since it was unveiled in 2009.  The damage caused the last time cost in excess of Â£1500 to repair," he said.
Mr MacVicar claimed: "There is absolutely no doubt that this is a further attempt by republicans to remove from history the fact that the IRA murdered three young boys, two brothers aged 17 and 18 and the third aged 23 who were unarmed and out for an off duty afternoon in Belfast in 1971 simply because they were in the British Army."
A spokesman for the Police Service of Northern Ireland (PSNI) said they had not yet received a report of the attack.
Last July, sectarian graffiti was scrawled on the memorial stone. Corner posts, and the surrounding rope were also broken.
The National Museum of Scotland overtook Edinburgh Castle to become the most popular visitor attraction in Scotland last year.
[NEXT_CONCEPT]
A memorial to three soldiers murdered by the IRA on the outskirts of Belfast has been vandalised for a fifth time, a local fundraiser has said.