It was played by band leader Wallace Hartley, who died along with 1,517 others as the ship went down. It had a guide price of £300,000.
The BBC's Duncan Kennedy said the buyer was believed to be British.
Auctioneer Alan Aldridge said the violin was the "rarest and most iconic" piece of Titanic memorabilia.
Many of the other items up for sale, such as photographs, newspapers and crockery, were sold for between £10 and a few hundred pounds.
By Duncan KennedyBBC News
What would Wallace Hartley have made of it all?
Well, the modest, jobbing, musician from Dewsbury in West Yorkshire, would probably not have believed it.
His violin, given to him by his fiancee, Maria, as an engagement present, going at auction for £900,000 (just over £1m when you add in buyers premium and VAT).
He'd only just got off the RMS Mauretania when his agent asked him if he wanted to go straight onto another voyage, the Titanic.
Hartley agreed, a move that would cost him his life but also create a legend.
There were gasps at the auction when the bidding passed half a million pounds.
But it kept climbing, the bidders in the room soon over taken by the serious money on the phones.
Any suggestion the violin wasn't authentic, as some have claimed, was swept away in a torrent of successively higher bids.
In the end, it beat the old world record for a single Titanic item four times over.
Played by a man who personifies a bygone era of high morals and values, it's more than just a violin, it's an instrument of history.
Mr Aldridge set the bidding at £50 for the violin, which was lot 230 of 251, so "two of his friends could bid" - but after just a couple of minutes it had passed £100,000.
It eventually sold for £900,000 after fierce bidding between two telephone bidders.
Hartley has become part of the ship's legend after leading his fellow musicians in playing as the vessel sank. They are famously said to have played the hymn Nearer My God To Thee.
It had taken seven years for the Devizes auction house, Henry Aldridge & Son, to authenticate the instrument.
Several experts were used, including forensic scientists who said the wood still contained salt deposits from the sea water.
Some people still doubt whether the violin is the genuine article, however, and believe it could not have survived being submerged in the sea.
But it is claimed the violin survived in a leather case strapped to Mr Harley's body who was found wearing his cork and linen lifejacket.
A diary entry by his fiancee, Maria Robinson, said it was saved from the water and returned to her.
Following her death in 1939, the violin was given to her local Salvation Army citadel and was later passed on to the current anonymous owner's mother in the early 1940s.
The auction house said it had attracted interest from collectors all over the world and added that more than 315,000 people viewed it during a three-month exhibition in the United States.
The most money previously paid for a piece of Titanic memorabilia is thought to have been a plan of the ship used in the 1912 inquiry into the sinking. This was bought by a private collector at auction for £220,000 in 2011.
The violin that was apparently played to calm passengers on the Titanic as it sank was sold for £900,000 in just 10 minutes at auction in Wiltshire.