The market research firm GfK conducted a one-off online survey of 2,000 people after the result was known.
Its confidence index fell by eight points to minus nine, a drop not since seen December 1994.
Less confident consumers tend to curb their spending, which accounts for about two-thirds of the UK economy.
It is also one measure watched by the Bank of England when deciding its next move on interest rates. Governor Mark Carney has already warned the UK's economic outlook is "challenging" following the decision to leave the EU.
The Gfk survey also suggested that 60% of consumers expect the general economic situation to worsen over the next year, compared with 46% in June. Just 20% expect it to improve, down from 27% last month.
The number of people who believe prices will rise rapidly in the next 12 months jumped to 33% from 13% in June.
It also showed regional differences in the fall in confidence - with the north of England seeing a 19 point drop and Scotland seeing an 11 point drop. The south of England saw just a two point drop.
The survey was run from 30 June to 5 July to capture the mood of consumers immediately after the referendum on 24 June.
"Our analysis suggests that in the immediate aftermath of the referendum, sectors like travel, fashion and lifestyle, home, living, DIY and grocery are particularly vulnerable to consumers cutting back their discretionary spending," said Joe Staton, head of market dynamics at GfK.
A separate survey indicated that retailers were already beginning to feel the impact.
The BDO's monthly High Street Sales Tracker showed a strong start to June, with sales growing 3.8% year on year. That decreased throughout the month and by the end of June, after the referendum, sales had fallen by 8.1% compared with last year.
Official economic figures from the Office for National Statistics that will reflect any Brexit impact will start being released in August.
Consumer confidence has seen its sharpest drop in 21 years after the UK vote to leave the EU, a survey suggests.