This was more than the amount invested per capita in the US tech sector in the same period, the Department of Digital, Culture, Media and Sport said.
Experts say the weaker pound is drawing investors to the UK tech sector, which leads Europe in terms of funding.
US and Asian firms invested most in the period, according to the study.
Collectively, these two regions spent $3.7bn (£3.02bn; €3.31bn) in the first seven months of the year – overtaking the $2.9bn invested across the whole of 2018.
It comes as overall foreign direct investment (FDI) in the UK is falling, amid uncertainty over Britain’s future trading arrangements with the EU.
According to the Department for International Trade, FDI hit a six-year low in June.
Commenting on the tech investment figures, culture secretary Nicky Morgan said: “These fantastic figures show the confidence overseas investors have in UK tech, with investment flows from the US and Asia at an all-time high.
“We have a long-standing reputation for innovation and the statistics endorse our reputation as one of the best places in the world to start and grow a digital business.”
Increasingly, UK companies have been heading abroad to regions like to Asia to raise capital.
“I’ve seen a lot more requests from UK start-ups tapping Asian markets capital financing in comparison to a year ago,” said Aditya Mathur, founder and managing director of Singapore based venture capital fund elev8.vc.
“They typically want access to the Asian market that is large and diverse, and for that they need an Asian investor to help them understand these markets, and also provide the kind of financing they’re looking for.”
UK tech firms also provide Asian investors with a way to hedge against the trade war, analysts say.
“Foreign investment into both the US and Chinese tech sectors has gone down because of the trade war and because Europe has provided several attractive investment opportunities lately” said Yoram Wijngaarde, founder and chief executive of Dealroom, the company that pulled together the figures for the research.
“The UK provides an attractive opportunity for funds looking to grow their investments.”
Recent deals have included an $800m investment by Japan’s Softbank in Britain’s Greensill, which provides short term loans to companies to help with their operational needs.
Softbank and the Singapore-based Clermont Group also invested $400m in UK firm OakNorth Bank, a digital-only bank providing loans for small and medium-sized companies.
Meanwhile, Amazon was the biggest investor in takeaway firm Deliveroo’s latest round of fund raising, which in total raised $575m (£450m).
Still, worries about what impact Brexit will have on the UK’s tech talent pool are worrying investors and companies, who are concerned the UK will see a brain drain if EU nationals aren’t able to work in the UK in the event of a no-deal Brexit.
“It’s our biggest concern right now,” said Russ Shaw, founder of Tech London Advocates, a campaign group promoting London’s technology sector.
“One in five tech workers in London is from the EU. We’re growing these businesses, and the money is flowing in, but we don’t have enough talent in the country.
“We need a transition plan for companies who need to know what to do about staffing after 31 October. Otherwise it undermines our credibility.”
Mr Shaw has said one of the ways the UK could mitigate these risks is by making the immigration process for overseas workers easier and more welcoming in the future.
Post from BBC