In remarks televised nationally, he said the US was ready to respond decisively to such a move.
The US president said Russia had now massed some 150,000 troops on the border with Ukraine.
Russia’s defence minister has said some forces have withdrawn. Mr Biden said that this had not been verified.
“[Russian forces leaving] would be good, but we have not yet verified that. We have not yet verified the Russian military units are returning to their home bases,” the US president said.
“Indeed, our analysts indicate that they remain very much in a threatening position.”
On Tuesday, Ukraine said the websites of its Defence Ministry and two banks came under a cyber-attack. The cause is not clear but Ukraine has suffered large-scale attacks before on its online infrastructure and has pointed the finger at Russia.
There has long been concern that, rather than a full-scale invasion, Russia could use less obvious means to destabilise Ukraine, for example through cyber-attacks on critical infrastructure. President Biden said on Tuesday the US was prepared to respond to any such move.
Mr Biden’s speech came hours after Russian President Vladimir Putin said Moscow’s security concerns should be addressed and taken seriously.
Mr Putin has always denied planning an incursion, and said Russia did not want another war in Europe. However, tensions have been rising since November.
Following earlier reports that US intelligence believed Russia could attack Ukraine on Wednesday, Ukrainian President Volodymyr Zelensky declared it to be a day of unity, calling on citizens to wave the country’s flag and wear blue and yellow ribbons – Ukraine’s national colours.
Russia has deep cultural and historic ties with Ukraine, which is a former Soviet republic.
Mr Putin wants assurances that it will not join the Western Nato military alliance because he sees any expansion of it as a threat to Russia. Nato has rejected that demand.
Mr Biden said he agreed with a proposal by the Russian government to continue diplomacy.
The US president also warned the American economy could suffer from disruption to energy supply and sharp price increases in the likely event that sanctions were levied on Russia in response to any invasion of Ukraine.
“The American people understand that defending democracy and liberty is never without cost,” the US president said. “I will not pretend this will be painless.”
He said the administration was working on contingency plans with energy producers and shippers to avert potential supply issues.
Mr Biden warned the proposed Russian Nord Stream 2 natural gas pipeline to Europe “will not happen” if a Ukraine invasion goes ahead.
The US president continued: “To the citizens of Russia: you are not our enemy, and I don’t believe you want a bloody, destructive war against Ukraine.”
Nato expressed “cautious optimism” on Tuesday about the Russian military’s announcement that it had pulled back some of its troops from the border with Ukraine.
US Secretary of State Antony Blinken told his Russian counterpart Sergei Lavrov in a call that the US needed to see “verifiable, credible, meaningful de-escalation”.
Earlier, British Prime Minister Boris Johnson tweeted that there were “mixed signals” coming from Russia, because UK intelligence showed Russian field hospitals were being built near the border which could “only be construed as a preparation for an invasion”.
Vladimir Putin said on Tuesday that Russia did not want war. He spoke following a four-hour meeting with German Chancellor Olaf Scholz.
Mr Putin also said that Nato had so far failed to address Russia’s “basic” security concerns. He is demanding that the issue of Ukraine joining Nato be addressed now – even through Ukraine is a long way from even starting an application to join the alliance.
Mr Scholz said at the joint press conference that the build-up of Russian troops was “incomprehensible”, but there was still a chance that diplomatic solutions could ease the tensions.
“I expressed that the troop build-up is seen as a threat,” Mr Scholz said at a media briefing. “Of course we are very concerned.”