"Although the background to these acts are not yet clear, I reaffirm that Germany and its citizens stand firmly and resolutely alongside Britons in the struggle against all forms of terrorism," Merkel said in a statement.
Four people were killed and around 40 were injured - including one German - in Wednesday's attack, in which a man mowed down pedestrians with a car, then stabbed a police officer outside parliament before being shot dead.
Germany has been on high alert since an Islamic State extremist ploughed a lorry into a Berlin Christmas market in December, killing 12 people.
"In these grave moments, we Germans feel very close to the British people," President Frank-Walter Steinmeier added in a statement.
British police said they were treating the attack as "terrorist" in nature. It came a year to the day after Isis jihadists killed 32 people in bombings in Brussels.